]> granicus.if.org Git - apache/commitdiff
Merge r1615289, r1620324 from trunk:
authorJim Jagielski <jim@apache.org>
Sun, 31 Aug 2014 16:07:45 +0000 (16:07 +0000)
committerJim Jagielski <jim@apache.org>
Sun, 31 Aug 2014 16:07:45 +0000 (16:07 +0000)
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.

Addition to r1615289.

Submitted by: rjung
Reviewed/backported by: jim

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

CHANGES
STATUS
modules/proxy/mod_proxy_http.c

diff --git a/CHANGES b/CHANGES
index 7154ea4e42addb7448fa0c8b42ec69daba9f6e49..b2b4c878723ed6df63e7af7a950f51dde46b5f39 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,10 @@
 
 Changes with Apache 2.4.11
 
+  *) mod_proxy_http: Proxy responses with error status and
+     "ProxyErrorOverride On" hang until proxy timeout.
+     PR53420 [Rainer Jung]
+
   *) SECURITY: CVE-2013-5704 (cve.mitre.org)
      core: HTTP trailers could be used to replace HTTP headers
      late during request processing, potentially undoing or
diff --git a/STATUS b/STATUS
index 2f06038ba628189d13548ebb9042046d2c008d2d..7ab2850b15963c77588f66a6626acc182ac5ea89 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -101,14 +101,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-   * mod_proxy_http: Proxy responses with error status and "ProxyErrorOverride On"
-     hang until proxy timeout.  PR53420
-     Regression from 2.2. It was introduced by r912063 in order to fix PR41646.
-     trunk patch: http://svn.apache.org/r1615289
-                  http://svn.apache.org/r1620324
-     2.4.x patch: trunk works (modulo CHANGES)
-     +1: rjung, ylavic, covener
-
    * mod_proxy_fcgi: Fix faulty logging of large amounts of stderr from the
      application.  PR 56858.
      trunk patch: http://svn.apache.org/r1618401
index 1a4d59372feb7e5042b51bc4cebf67383f65fc30..b8f06c111e8dfc753c8ae600ac63e0ae8238b307 100644 (file)
@@ -1652,6 +1652,18 @@ apr_status_t ap_proxy_http_process_response(apr_pool_t * p, request_rec *r,
             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;