]> granicus.if.org Git - apache/commitdiff
expose more worker status info in prep for making
authorJim Jagielski <jim@apache.org>
Tue, 2 Feb 2016 14:56:30 +0000 (14:56 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 2 Feb 2016 14:56:30 +0000 (14:56 +0000)
more dynamically changable

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1728142 13f79535-47bb-0310-9956-ffa450edef68

modules/proxy/mod_proxy.h
modules/proxy/mod_proxy_balancer.c

index c1d32bf354e3dc4424d47032b66eac7a5a958c8b..c8817bd32e16978e860ad44ba7e6d4d0c9f3187a 100644 (file)
@@ -310,7 +310,7 @@ struct proxy_conn_pool {
 #define PROXY_WORKER_IN_ERROR_FLAG       'E'
 #define PROXY_WORKER_HOT_STANDBY_FLAG    'H'
 #define PROXY_WORKER_FREE_FLAG           'F'
-#define PROXY_WORKER_HC_FAIL_FLAG        '#'
+#define PROXY_WORKER_HC_FAIL_FLAG        'C'
 
 #define PROXY_WORKER_NOT_USABLE_BITMAP ( PROXY_WORKER_IN_SHUTDOWN | \
 PROXY_WORKER_DISABLED | PROXY_WORKER_STOPPED | PROXY_WORKER_IN_ERROR | \
@@ -330,6 +330,8 @@ PROXY_WORKER_HC_FAIL )
 
 #define PROXY_WORKER_IS_HCFAILED(f)   ( (f)->s->status &  PROXY_WORKER_HC_FAIL )
 
+#define PROXY_WORKER_IS(f, b)   ( (f)->s->status & (b) )
+
 /* default worker retry timeout in seconds */
 #define PROXY_WORKER_DEFAULT_RETRY    60
 
index e1d518f96badb990eebfa136db4c39fd0057747e..1e2804250e705bc7795643126dfafa4240e9a2ab 100644 (file)
@@ -1339,18 +1339,7 @@ static int balancer_handler(request_rec *r)
                 }
                 /* Begin proxy_worker_stat */
                 ap_rputs("          <httpd:status>", r);
-                if (worker->s->status & PROXY_WORKER_DISABLED)
-                    ap_rputs("Disabled", r);
-                else if (worker->s->status & PROXY_WORKER_IN_ERROR)
-                    ap_rputs("Error", r);
-                else if (worker->s->status & PROXY_WORKER_STOPPED)
-                    ap_rputs("Stopped", r);
-                else if (worker->s->status & PROXY_WORKER_HOT_STANDBY)
-                    ap_rputs("Standby", r);
-                else if (PROXY_WORKER_IS_USABLE(worker))
-                    ap_rputs("OK", r);
-                else if (!PROXY_WORKER_IS_INITIALIZED(worker))
-                    ap_rputs("Uninitialized", r);
+                ap_rputs(ap_proxy_parse_wstatus(r->pool, worker), r);
                 ap_rputs("</httpd:status>\n", r);
                 if ((worker->s->error_time > 0) && apr_rfc822_date(date, worker->s->error_time) == APR_SUCCESS) {
                     ap_rvputs(r, "          <httpd:error_time>", date,
@@ -1601,11 +1590,15 @@ static int balancer_handler(request_rec *r)
                      "<th>Ignore Errors</th>"
                      "<th>Draining Mode</th>"
                      "<th>Disabled</th>"
-                     "<th>Hot Standby</th></tr>\n<tr>", r);
-            create_radio("w_status_I", (PROXY_WORKER_IGNORE_ERRORS & wsel->s->status), r);
-            create_radio("w_status_N", (PROXY_WORKER_DRAIN & wsel->s->status), r);
-            create_radio("w_status_D", (PROXY_WORKER_DISABLED & wsel->s->status), r);
-            create_radio("w_status_H", (PROXY_WORKER_HOT_STANDBY & wsel->s->status), r);
+                     "<th>Hot Standby</th>"
+                     "<th>HC Fail</th>"
+                     "<th>Stopped</th></tr>\n<tr>", r);
+            create_radio("w_status_I", (PROXY_WORKER_IS(wsel, PROXY_WORKER_IGNORE_ERRORS)), r);
+            create_radio("w_status_N", (PROXY_WORKER_IS(wsel, PROXY_WORKER_DRAIN)), r);
+            create_radio("w_status_D", (PROXY_WORKER_IS(wsel, PROXY_WORKER_DISABLED)), r);
+            create_radio("w_status_H", (PROXY_WORKER_IS(wsel, PROXY_WORKER_HOT_STANDBY)), r);
+            create_radio("w_status_C", (PROXY_WORKER_IS(wsel, PROXY_WORKER_HC_FAIL)), r);
+            create_radio("w_status_S", (PROXY_WORKER_IS(wsel, PROXY_WORKER_STOPPED)), r);
             ap_rputs("</tr></table>\n", r);
             ap_rputs("<tr><td colspan=2><input type=submit value='Submit'></td></tr>\n", r);
             ap_rvputs(r, "</table>\n<input type=hidden name='w' id='w' ",  NULL);