]> granicus.if.org Git - apache/commitdiff
PR53420: Proxy responses with error status and
authorRainer Jung <rjung@apache.org>
Sat, 2 Aug 2014 08:24:35 +0000 (08:24 +0000)
committerRainer Jung <rjung@apache.org>
Sat, 2 Aug 2014 08:24:35 +0000 (08:24 +0000)
"ProxyErrorOverride On" hang until proxy timeout.

Regression from 2.2. It was introduced by r912063
in order to fix PR41646.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1615289 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
modules/proxy/mod_proxy_http.c

diff --git a/CHANGES b/CHANGES
index a20bdd9ea701c4d4e11542807b7fb68ce894c250..c87f5c98198a654f23c7a14c5921d0d58b0b94c3 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_http: Proxy responses with error status and
+     "ProxyErrorOverride On" hang until proxy timeout.
+     PR53420 [Rainer Jung]
+
   *) mod_proxy_wstunnel: Concurrent websockets messages could be 
      lost or delayed with ProxyWebsocketAsync enabled.  
      [Edward Lu <Chaosed0 gmail.com>]
index 91d14f5a98a8a27b72cbcf3eafba4c05824ee276..f8813691f18f163fb9fda60f6e03796ad6517b91 100644 (file)
@@ -1637,6 +1637,18 @@ int 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, "Content-Length"))) {
+                    apr_table_set(backend->r->headers_in, "Content-Length", tmp);
+                }
+                else if ((tmp = apr_table_get(r->headers_out, "Transfer-Encoding"))) {
+                    apr_table_set(backend->r->headers_in, "Transfer-Encoding", tmp);
+                }
+                else if (te) {
+                    apr_table_set(backend->r->headers_in, "Transfer-Encoding", te);
+                }
                 ap_discard_request_body(backend->r);
             }
             proxy_run_detach_backend(r, backend);