From a8619ad6f74bb05c0582a650e9f617e37e0f559d Mon Sep 17 00:00:00 2001 From: Kano Date: Fri, 4 May 2012 20:54:11 +1000 Subject: [PATCH] API support new pool status --- api.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/api.c b/api.c index 1bf9b2b7..6c884373 100644 --- a/api.c +++ b/api.c @@ -164,6 +164,8 @@ static const char *SICK = "Sick"; static const char *NOSTART = "NoStart"; static const char *DISABLED = "Disabled"; static const char *ALIVE = "Alive"; +static const char *REJECTING = "Rejecting"; +static const char *UNKNOWN = "Unknown"; #define _DYNAMIC "D" static const char *DYNAMIC = _DYNAMIC; @@ -1203,13 +1205,22 @@ static void poolstatus(__maybe_unused SOCKETTYPE c, __maybe_unused char *param, for (i = 0; i < total_pools; i++) { struct pool *pool = pools[i]; - if (!pool->enabled) + switch (pool->enabled) { + case POOL_DISABLED: status = (char *)DISABLED; - else { + break; + case POOL_REJECTING: + status = (char *)REJECTING; + break; + case POOL_ENABLED: if (pool->idle) status = (char *)DEAD; else status = (char *)ALIVE; + break; + default: + status = (char *)UNKNOWN; + break; } if (pool->hdr_path)