From 4ee264e17b21c2f8ec367e49fb4b1c215dc9420b Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Fri, 27 Mar 2015 12:22:32 +0000 Subject: [PATCH] Merge r1658760 from trunk: mod_proxy_http: Don't expect the backend to ack the "Connection: close" to finally close those not meant to be kept alive by SetEnv proxy-nokeepalive or force-proxy-request-1.0, and respond with 502 instead of 400 if its Connection header is invalid. Submitted by: ylavic Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1669558 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 4 ++++ modules/proxy/mod_proxy_http.c | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGES b/CHANGES index 1a1f34b5b1..9f542063d6 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,10 @@ Changes with Apache 2.4.13 context for directories found by mod_userdir and mod_alias. These no longer require RewriteBase to be specified. [Eric Covener] + *) mod_proxy_http: Don't expect the backend to ack the "Connection: close" to + finally close those not meant to be kept alive by SetEnv proxy-nokeepalive + or force-proxy-request-1.0. [Yann Ylavic] + *) mod_lua: After a r:wsupgrade(), mod_lua was not properly responding to a websockets PING but instead invoking the specified script. PR57524. [Edward Lu ] diff --git a/modules/proxy/mod_proxy_http.c b/modules/proxy/mod_proxy_http.c index 98a93dd282..9ca3917674 100644 --- a/modules/proxy/mod_proxy_http.c +++ b/modules/proxy/mod_proxy_http.c @@ -1383,6 +1383,7 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, */ if (apr_date_checkmask(buffer, "HTTP/#.# ###*")) { int major, minor; + int toclose; major = buffer[5] - '0'; minor = buffer[7] - '0'; @@ -1491,7 +1492,10 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r, te = apr_table_get(r->headers_out, "Transfer-Encoding"); /* strip connection listed hop-by-hop headers from response */ - backend->close = ap_proxy_clear_connection_fn(r, r->headers_out); + toclose = ap_proxy_clear_connection_fn(r, r->headers_out); + if (toclose) { + backend->close = 1; + } if ((buf = apr_table_get(r->headers_out, "Content-Type"))) { ap_set_content_type(r, apr_pstrdup(p, buf)); -- 2.50.1