From c84854f270ff7c4992e8c49923a44e46d49ecc94 Mon Sep 17 00:00:00 2001 From: "William A. Rowe Jr" Date: Wed, 11 Aug 2004 23:07:16 +0000 Subject: [PATCH] Make sure that if the pre_request was called that the post_request gets called too, no mather what the error code is. Submitted by: mturk git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@104620 13f79535-47bb-0310-9956-ffa450edef68 --- modules/proxy/mod_proxy.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index f24f4ba4f9..c37366a2fb 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -97,7 +97,7 @@ static const char *set_worker_param(apr_pool_t *p, else if (!strcasecmp(key, "retry")) { ival = atoi(val); if (ival < 1) - return "Retry must be al least one second"; + return "Retry must be at least one second"; worker->retry = apr_time_from_sec(ival); } else if (!strcasecmp(key, "ttl")) { @@ -631,7 +631,7 @@ static int proxy_handler(request_rec *r) /* an error or success */ if (access_status != DECLINED && access_status != HTTP_BAD_GATEWAY) { - return access_status; + goto cleanup; } /* we failed to talk to the upstream proxy */ } @@ -653,12 +653,15 @@ static int proxy_handler(request_rec *r) "If you are using a DSO version of mod_proxy, make sure " "the proxy submodules are included in the configuration " "using LoadModule.", r->uri); - return HTTP_FORBIDDEN; + access_status = HTTP_FORBIDDEN; + goto cleanup; } + +cleanup: if (balancer) { - access_status = proxy_run_post_request(worker, balancer, r, conf); - if (access_status == DECLINED) { - access_status = OK; /* no post_request handler available */ + int post_status = proxy_run_post_request(worker, balancer, r, conf); + if (post_status == DECLINED) { + post_status = OK; /* no post_request handler available */ /* TODO: reclycle direct worker */ } } -- 2.50.1