]> granicus.if.org Git - apache/commitdiff
mod_proxy: Don't put the worker in error state for 500 or 503 errors
authorYann Ylavic <ylavic@apache.org>
Tue, 26 May 2015 07:25:08 +0000 (07:25 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 26 May 2015 07:25:08 +0000 (07:25 +0000)
returned by the backend unless failonstatus is configured to.  PR 56925.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1681694 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/mod_proxy.c
modules/proxy/mod_proxy_http.c

diff --git a/CHANGES b/CHANGES
index 796d03c8f0345f3c98729f873087f95b02f96d7f..701a9302bc573d70421db2fafd7ecce40749c0ba 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy: Don't put the worker in error state for 500 or 503 errors
+     returned by the backend unless failonstatus is configured to.  PR 56925.
+     [Yann Ylavic]
+
   *) http: Don't remove the Content-Length of zero from a HEAD response if
      it comes from an origin server, module or script.  [Yann Ylavic]
 
index 476537b9c8b0544bc340c62c623f8e194c2c9a46..d9381332b5dc59a6c3431f544b79ba1de9be09f1 100644 (file)
@@ -1169,7 +1169,8 @@ static int proxy_handler(request_rec *r)
         AP_PROXY_RUN(r, worker, conf, url, attempts);
         access_status = proxy_run_scheme_handler(r, worker, conf,
                                                  url, NULL, 0);
-        if (access_status == OK)
+        if (access_status == OK
+                || apr_table_get(r->notes, "proxy-error-override"))
             break;
         else if (access_status == HTTP_INTERNAL_SERVER_ERROR) {
             /* Unrecoverable server error.
index 0f4e0167d5ccb515fdb321cee82128d4e74dd5ed..6eb9e7a4174e97c70fae03814899515024ae075f 100644 (file)
@@ -1719,6 +1719,7 @@ int ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                 ap_discard_request_body(backend->r);
             }
             proxy_run_detach_backend(r, backend);
+            apr_table_setn(r->notes, "proxy-error-override", "1");
             return proxy_status;
         }