From 08672e6bfe86e79fd485ea3559d2e8471bd9e7da Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Tue, 2 Jun 2015 13:39:26 +0000 Subject: [PATCH] Merge r1681694, r1682907 from trunk: 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 | 4 ++++ STATUS | 7 ------- modules/proxy/mod_proxy.c | 3 ++- modules/proxy/mod_proxy_ajp.c | 5 +++++ modules/proxy/mod_proxy_http.c | 5 +++++ 5 files changed, 16 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index 3e402f8b41..517a9299ae 100644 --- 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 ] + *) 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 552eeb4a07..6bab9da7f1 100644 --- 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 diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 019c180205..6a1c3cf523 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -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. diff --git a/modules/proxy/mod_proxy_ajp.c b/modules/proxy/mod_proxy_ajp.c index a2c4c216a2..0014a7c6bb 100644 --- a/modules/proxy/mod_proxy_ajp.c +++ b/modules/proxy/mod_proxy_ajp.c @@ -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; diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 374d60a1cf..319721f3a5 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -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; } -- 2.50.1