From: Jim Jagielski Date: Tue, 29 Mar 2016 16:47:05 +0000 (+0000) Subject: Some flow improvements... X-Git-Tag: 2.5.0-alpha~1820 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=69b41bc90b8977a446ff127a6263f647d0a1d00e;p=apache Some flow improvements... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1737020 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/proxy/mod_proxy_hcheck.c b/modules/proxy/mod_proxy_hcheck.c index 68b7f575f4..c8f1a7b17c 100644 --- a/modules/proxy/mod_proxy_hcheck.c +++ b/modules/proxy/mod_proxy_hcheck.c @@ -687,7 +687,7 @@ static apr_status_t hc_check_http(sctx_t *ctx, apr_pool_t *ptemp, proxy_worker * request_rec *r; wctx_t *wctx; hc_condition_t *cond; - const char *method; + const char *method = NULL; hc = hc_get_hcworker(ctx, worker, ptemp); wctx = (wctx_t *)hc->context; @@ -715,27 +715,21 @@ static apr_status_t hc_check_http(sctx_t *ctx, apr_pool_t *ptemp, proxy_worker * break; case HEAD: - if (!wctx->req) { - wctx->req = apr_psprintf(ctx->p, - "HEAD %s%s%s HTTP/1.0\r\nHost: %s:%d\r\n\r\n", - (wctx->path ? wctx->path : ""), - (wctx->path && *hc->s->hcuri ? "/" : "" ), - (*hc->s->hcuri ? hc->s->hcuri : ""), - hc->s->hostname, (int)hc->s->port); - } method = "HEAD"; - break; - + /* fallthru */ case GET: + if (!method) { /* did we fall thru? If not, we are GET */ + method = "GET"; + } if (!wctx->req) { wctx->req = apr_psprintf(ctx->p, - "GET %s%s%s HTTP/1.0\r\nHost: %s:%d\r\n\r\n", + "%s %s%s%s HTTP/1.0\r\nHost: %s:%d\r\n\r\n", + method, (wctx->path ? wctx->path : ""), (wctx->path && *hc->s->hcuri ? "/" : "" ), (*hc->s->hcuri ? hc->s->hcuri : ""), hc->s->hostname, (int)hc->s->port); } - method = "GET"; break; default: @@ -923,15 +917,15 @@ static apr_status_t hc_watchdog_callback(int state, void *data, baton->worker = worker; baton->ptemp = ptemp; - if (ctx->hctp) { + if (!ctx->hctp) { + hc_check(NULL, baton); + } #if HC_USE_THREADS + else { rv = apr_thread_pool_push(ctx->hctp, hc_check, (void *)baton, APR_THREAD_TASK_PRIORITY_NORMAL, NULL); -#endif - ; - } else { - hc_check(NULL, baton); } +#endif } workers++; }