]> granicus.if.org Git - apache/commitdiff
Merge r1681694, r1682907 from trunk:
authorJim Jagielski <jim@apache.org>
Tue, 2 Jun 2015 13:39:26 +0000 (13:39 +0000)
committerJim Jagielski <jim@apache.org>
Tue, 2 Jun 2015 13:39:26 +0000 (13:39 +0000)
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.

mod_proxy: follow up to r1681694.

Handle the proxy-error-override note also in mod_proxy_ajp.

The note is not needed in mod_proxy_fcgi (which also handles
ProxyErrorOverride) since it calls ap_die() by itself, and always
returns OK to proxy_handler().

Add a comment about the note where used.

Submitted by: ylavic
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1683112 13f79535-47bb-0310-9956-ffa450edef68

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

diff --git a/CHANGES b/CHANGES
index 3e402f8b4198edd0726a43c20bba21f637617e8e..517a9299ae91440fb032e8980647c1949c094247 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -12,6 +12,10 @@ Changes with Apache 2.4.13
      calls r:wsupgrade() can cause a child process crash. 
      [Edward Lu <Chaosed0 gmail.com>]
 
+  *) 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]
+
   *) core: Don't lowercase the argument to SetHandler if it begins with
      "proxy:unix". PR 57968. [Eric Covener]
 
diff --git a/STATUS b/STATUS
index 552eeb4a07c65988fe3ad58d6be879e09399a662..6bab9da7f1484b80ca8513f1e282fca0a967efeb 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -105,13 +105,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) 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.
-     trunk patch: http://svn.apache.org/r1681694
-     trunk patch: http://svn.apache.org/r1682907
-     2.4.x patch: trunk works (modulo CHANGES)
-     +1: ylavic, rjung, jim
-
    *) Easy patches - synch with trunk
         - mod_rewrite: Initialize args to not print garbage mem during a RewriteCond parse error
         - mod_rewrite: Initialize args to not print garbage mem during a RewriteRule parse error
index 019c18020597120ea38529851c1525d54befd793..6a1c3cf52318e7a988c008afbc1149ca142f7131 100644 (file)
@@ -1160,7 +1160,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 a2c4c216a2df29bcfdfd915e3621789507744f5d..0014a7c6bb8720614e11987e263264052a08ba47 100644 (file)
@@ -644,6 +644,11 @@ static int ap_proxy_ajp_request(apr_pool_t *p, request_rec *r,
              */
             rv = r->status;
             r->status = HTTP_OK;
+            /*
+             * prevent proxy_handler() from treating this as an
+             * internal error.
+             */
+            apr_table_setn(r->notes, "proxy-error-override", "1");
         }
         else {
             rv = OK;
index 374d60a1cfdcf4ffa22fdb3097ce656511224226..319721f3a5c8a4de42b8b6fca54bfbe073955151 100644 (file)
@@ -1662,6 +1662,11 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
                 }
                 ap_discard_request_body(backend->r);
             }
+            /*
+             * prevent proxy_handler() from treating this as an
+             * internal error.
+             */
+            apr_table_setn(r->notes, "proxy-error-override", "1");
             return proxy_status;
         }