]> granicus.if.org Git - apache/commitdiff
Expose this in our API
authorJim Jagielski <jim@apache.org>
Mon, 18 Jan 2016 16:54:06 +0000 (16:54 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 18 Jan 2016 16:54:06 +0000 (16:54 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725306 13f79535-47bb-0310-9956-ffa450edef68

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

index 06c9673f6a11cca1408a4aad9dc0c5d80fde8e34..d973f1f027b00e20e959b825743d6c35688b50ba 100644 (file)
@@ -1119,6 +1119,13 @@ int ap_proxy_lb_workers(void);
  */
 PROXY_DECLARE(apr_port_t) ap_proxy_port_of_scheme(const char *scheme);
 
+/**
+ * Return the name of the health check method (eg: "OPTIONS").
+ * @param method        method enum
+ * @return              name of method
+ */
+PROXY_DECLARE (const char *) ap_proxy_show_hcmethod(hcmethod_t method);
+
 /**
  * Strip a unix domain socket (UDS) prefix from the input URL
  * @param p             pool to allocate result from
index 376100546c528e89981a942ef33d5c8e7db9a190..d24fe6935ee41b9a33b1c0cbf5f1bed1f8da79a8 100644 (file)
@@ -973,17 +973,6 @@ static void push2table(const char *input, apr_table_t *params,
     }
 }
 
-static const char *show_hcmethod(hcmethod_t method)
-{
-    hcmethods_t *m = hcmethods;
-    for (; m->name; m++) {
-        if (m->method == method) {
-            return m->name;
-        }
-    }
-    return "???";
-}
-
 /* Manages the loadfactors and member status
  *   The balancer, worker and nonce are obtained from
  *   the request args (?b=...&w=...&nonce=....).
@@ -1568,7 +1557,7 @@ static int balancer_handler(request_rec *r)
                 ap_rputs("</td><td>", r);
                 ap_rputs(apr_strfsize(worker->s->read, fbuf), r);
                 if (set_worker_hc_param_f) {
-                    ap_rprintf(r, "</td><td>%s</td>", show_hcmethod(worker->s->method));
+                    ap_rprintf(r, "</td><td>%s</td>", ap_proxy_show_hcmethod(worker->s->method));
                     ap_rprintf(r, "<td>%d</td>", (int)apr_time_sec(worker->s->interval));
                     ap_rprintf(r, "<td>%d</td>", worker->s->passes);
                     ap_rprintf(r, "<td>%d</td>", worker->s->fails);
index f2695cef3c401e77ee3ccc99e59740a1eef58a3e..badc6fa1f431e4a124e64a810223bab7d76763f7 100644 (file)
@@ -3699,6 +3699,17 @@ PROXY_DECLARE(apr_port_t) ap_proxy_port_of_scheme(const char *scheme)
     return 0;
 }
 
+PROXY_DECLARE (const char *) ap_proxy_show_hcmethod(hcmethod_t method)
+{
+    hcmethods_t *m = hcmethods;
+    for (; m->name; m++) {
+        if (m->method == method) {
+            return m->name;
+        }
+    }
+    return "???";
+}
+
 void proxy_util_register_hooks(apr_pool_t *p)
 {
     APR_REGISTER_OPTIONAL_FN(ap_proxy_retry_worker);