diff -Nru apache2-2.4.7/debian/changelog apache2-2.4.7/debian/changelog --- apache2-2.4.7/debian/changelog 2016-04-20 16:02:26.000000000 +0000 +++ apache2-2.4.7/debian/changelog 2016-06-27 12:29:02.000000000 +0000 @@ -1,3 +1,10 @@ +apache2 (2.4.7-1ubuntu4.11) trusty; urgency=medium + + * Fix hang until proxy timeout for Proxy responses with error status and + "ProxyErrorOverride On" being set (LP: #1495988). + + -- Christian Ehrhardt Tue, 07 Jun 2016 16:28:05 +0200 + apache2 (2.4.7-1ubuntu4.10) trusty; urgency=medium * Add apache2 specific modification needed along with fix to diff -Nru apache2-2.4.7/debian/patches/fix-proxy-error-overwrite-timeout.patch apache2-2.4.7/debian/patches/fix-proxy-error-overwrite-timeout.patch --- apache2-2.4.7/debian/patches/fix-proxy-error-overwrite-timeout.patch 1970-01-01 00:00:00.000000000 +0000 +++ apache2-2.4.7/debian/patches/fix-proxy-error-overwrite-timeout.patch 2016-06-27 12:29:02.000000000 +0000 @@ -0,0 +1,54 @@ +Description: Fix Proxy responses with error status and "ProxyErrorOverride On" + +PR53420: Proxy responses with error status and +"ProxyErrorOverride On" hang until proxy timeout. + +Regression from 2.2. It was introduced by r912063 +in order to fix PR41646. + +Switch preference for headers, Transfer-Encoding +first, Content-Length second. + +Author: Jim Jagielski +Reviewed-by: Christian Ehrhardt +Origin: upstream, https://svn.apache.org/viewvc?view=revision&revision=1621601 +Bug: https://bz.apache.org/bugzilla/show_bug.cgi?id=53420 +Bug-Ubuntu: https://launchpad.net/bugs/1495988 +Index: apache2-2.4.7/CHANGES +=================================================================== +--- apache2-2.4.7.orig/CHANGES ++++ apache2-2.4.7/CHANGES +@@ -2,6 +2,10 @@ + + Changes with Apache 2.4.7 + ++ *) mod_proxy_http: Proxy responses with error status and ++ "ProxyErrorOverride On" hang until proxy timeout. ++ PR53420 [Rainer Jung] ++ + *) mod_proxy_wstunnel: Don't pool backend websockets connections, + because we need to handshake every time. PR 55890. + [Eric Covener] +Index: apache2-2.4.7/modules/proxy/mod_proxy_http.c +=================================================================== +--- apache2-2.4.7.orig/modules/proxy/mod_proxy_http.c ++++ apache2-2.4.7/modules/proxy/mod_proxy_http.c +@@ -1635,6 +1635,18 @@ apr_status_t ap_proxy_http_process_respo + if (!r->header_only && /* not HEAD request */ + (proxy_status != HTTP_NO_CONTENT) && /* not 204 */ + (proxy_status != HTTP_NOT_MODIFIED)) { /* not 304 */ ++ const char *tmp; ++ /* Add minimal headers needed to allow http_in filter ++ * detecting end of body without waiting for a timeout. */ ++ if ((tmp = apr_table_get(r->headers_out, "Transfer-Encoding"))) { ++ apr_table_set(backend->r->headers_in, "Transfer-Encoding", tmp); ++ } ++ else if ((tmp = apr_table_get(r->headers_out, "Content-Length"))) { ++ apr_table_set(backend->r->headers_in, "Content-Length", tmp); ++ } ++ else if (te) { ++ apr_table_set(backend->r->headers_in, "Transfer-Encoding", te); ++ } + ap_discard_request_body(backend->r); + } + return proxy_status; diff -Nru apache2-2.4.7/debian/patches/series apache2-2.4.7/debian/patches/series --- apache2-2.4.7/debian/patches/series 2016-01-13 21:34:48.000000000 +0000 +++ apache2-2.4.7/debian/patches/series 2016-06-27 12:29:02.000000000 +0000 @@ -24,3 +24,4 @@ wstunnel-ssl.patch server_config_defines.patch fix_mod_proxy_wstunnel.patch +fix-proxy-error-overwrite-timeout.patch