diff options
author | Martin Willi <martin@strongswan.org> | 2008-07-23 13:56:07 +0000 |
---|---|---|
committer | Martin Willi <martin@strongswan.org> | 2008-07-23 13:56:07 +0000 |
commit | a01ad993411a729544447b5f9f83f60133c84b09 (patch) | |
tree | ddc40558a070499654791a413793043a50d06d8a | |
parent | 641023133594165e17ab79d1780167fab6969106 (diff) | |
download | strongswan-a01ad993411a729544447b5f9f83f60133c84b09.tar.bz2 strongswan-a01ad993411a729544447b5f9f83f60133c84b09.tar.xz |
fixed pool statistics
-rw-r--r-- | src/charon/plugins/sql/pool.c | 4 |
1 files 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) |