]> granicus.if.org Git - apache/commitdiff
Make sure that if the pre_request was called that the post_request
authorWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 23:07:16 +0000 (23:07 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Wed, 11 Aug 2004 23:07:16 +0000 (23:07 +0000)
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

index f24f4ba4f9c284c7d44648dd59018389d83dce9e..c37366a2fb718da0d0c3be0a85d9d8cc6d581cc7 100644 (file)
@@ -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 */
         }
     }