From: Jim Jagielski Date: Tue, 19 Jan 2016 12:49:56 +0000 (+0000) Subject: Open up hook/scar to allow for passes/fails and X-Git-Tag: 2.5.0-alpha~2368 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=52916ae253672acaa21b8e77e01dc5e0536581d5;p=apache Open up hook/scar to allow for passes/fails and method to be changed via bal-man... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1725498 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_balancer.c b/modules/proxy/mod_proxy_balancer.c index d24fe6935e..7de92984bc 100644 --- a/modules/proxy/mod_proxy_balancer.c +++ b/modules/proxy/mod_proxy_balancer.c @@ -1559,8 +1559,8 @@ static int balancer_handler(request_rec *r) if (set_worker_hc_param_f) { ap_rprintf(r, "%s", ap_proxy_show_hcmethod(worker->s->method)); ap_rprintf(r, "%d", (int)apr_time_sec(worker->s->interval)); - ap_rprintf(r, "%d", worker->s->passes); - ap_rprintf(r, "%d", worker->s->fails); + ap_rprintf(r, "%d (%d)", worker->s->passes,worker->s->pcount); + ap_rprintf(r, "%d (%d)", worker->s->fails, worker->s->fcount); ap_rprintf(r, "%s", worker->s->hcuri); } ap_rputs("\n", r); diff --git a/modules/proxy/mod_proxy_hcheck.c b/modules/proxy/mod_proxy_hcheck.c index fa755b8d80..9687c771e5 100644 --- a/modules/proxy/mod_proxy_hcheck.c +++ b/modules/proxy/mod_proxy_hcheck.c @@ -48,9 +48,11 @@ typedef struct { server_rec *s; } sctx_t; +/* Used in the HC worker via the context field */ typedef struct { - char *path; - char *req; + char *path; /* The path of the original worker URL */ + char *req; /* pre-formatted HTTP/AJP request */ + proxy_worker *w; /* Pointer to the actual worker */ } wctx_t; static void *hc_create_config(apr_pool_t *p, server_rec *s) @@ -366,14 +368,21 @@ static proxy_worker *hc_get_hcworker(sctx_t *ctx, proxy_worker *worker, /* tuck away since we need the preparsed address */ hc->cp->addr = worker->cp->addr; hc->s->method = worker->s->method; - rv = apr_uri_parse(p, url, &uri); if (rv == APR_SUCCESS) { wctx->path = apr_pstrdup(ctx->p, uri.path); } + wctx->w = worker; hc->context = wctx; apr_hash_set(ctx->hcworkers, wptr, APR_HASH_KEY_STRING, hc); } + /* This *could* have changed via the Balancer Manager */ + if (hc->s->method != worker->s->method) { + wctx_t *wctx = hc->s->context; + hc->s->method = worker->s->method; + wctx->req = NULL; + apr_hash_set(ctx->hcworkers, wptr, APR_HASH_KEY_STRING, hc); + } return hc; }