From 608a751ad6b65675975c0656f81f8a599680d6bb Mon Sep 17 00:00:00 2001 From: Yann Ylavic Date: Tue, 26 May 2015 07:25:08 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1681694 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/proxy/mod_proxy.c | 3 ++- modules/proxy/mod_proxy_http.c | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 796d03c8f0..701a9302bc 100644 --- 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] diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c index 476537b9c8..d9381332b5 100644 --- a/modules/proxy/mod_proxy.c +++ b/modules/proxy/mod_proxy.c @@ -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. diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 0f4e0167d5..6eb9e7a417 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -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; } -- 2.40.0