From a01ad993411a729544447b5f9f83f60133c84b09 Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Wed, 23 Jul 2008 13:56:07 +0000 Subject: [PATCH] fixed pool statistics --- src/charon/plugins/sql/pool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charon/plugins/sql/pool.c b/src/charon/plugins/sql/pool.c index 288ef06b4..c3d202a22 100644 --- a/src/charon/plugins/sql/pool.c +++ b/src/charon/plugins/sql/pool.c @@ -148,7 +148,7 @@ static void status(void) printf("%6d ", size); /* get number of online hosts */ lease = db->query(db, "SELECT COUNT(*) FROM addresses " - "WHERE pool = ? AND acquired != 0 AND released = 0", + "WHERE pool = ? AND released = 0", DB_UINT, id, DB_INT); if (lease) { @@ -159,7 +159,7 @@ static void status(void) /* get number of online or valid lieases */ lease = db->query(db, "SELECT COUNT(*) FROM addresses JOIN pools " "ON addresses.pool = pools.id " - "WHERE pools.id = ? AND acquired != 0 " + "WHERE pools.id = ? " "AND (released = 0 OR released > ? - timeout) ", DB_UINT, id, DB_UINT, time(NULL), DB_UINT); if (lease)