]> granicus.if.org Git - apache/commitdiff
Merge r1753167 from trunk:
authorJim Jagielski <jim@apache.org>
Thu, 25 Aug 2016 12:50:22 +0000 (12:50 +0000)
committerJim Jagielski <jim@apache.org>
Thu, 25 Aug 2016 12:50:22 +0000 (12:50 +0000)
mod_proxy_fcgi: avoid loops serving proxied error documents

This commit should solve the issue indicated in PR 55415.
Httpd loops while serving a error document if:
1) The error document's content is proxied.
2) ProxyErrorOverride is set.
The solution proposed is to limit the use of ap_die only
to the initial request. I tested the change with very basic
scenarios but I am not sure if I got all the use cases,
feedback is really welcome.

Submitted by: elukey
Reviewed/backported by: jim

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

CHANGES
STATUS
modules/proxy/mod_proxy_fcgi.c

diff --git a/CHANGES b/CHANGES
index 4af97f686fb3f32f395599dd76275fcca5227a97..ac799bdf9a1168887324e3515c99c3104dd75059 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.24
 
+  *) mod_proxy_fcgi: avoid loops when ProxyErrorOverride is enabled
+     and the error documents are proxied. PR 55415. [Luca Toscano]
+
   *) mod_proxy_fcgi: read the whole FCGI response even when the content has
      not been modified (HTTP 304) to avoid subsequent bougus reads and
      confusing error messages logged. [Luca Toscano]
diff --git a/STATUS b/STATUS
index ce873ad8987db12c43d1deac7ac135f7c5e4b4a3..e30c2cae3e9fdf8f10705dfe993c6aad1a699eec 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -117,11 +117,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_proxy_fcgi: avoid loops serving proxied error documents.
-     trunk patch: http://svn.apache.org/r1753167
-     2.4.x patch: trunk works (modulo CHANGES)
-     +1: elukey, ylavic, sf
-
   *) mod_http: Add the HEAD method to the lookup hash for completeness.
       Trunk version of patch:
          http://svn.apache.org/r1753257
index edbd23daa4abfbf9064c05f1d7bc267eb05f864f..943e04dc4598a2e58f8d81e6f4c05574e21e6623 100644 (file)
@@ -678,8 +678,8 @@ recv_again:
                                 }
                             }
 
-                            if (conf->error_override &&
-                                ap_is_HTTP_ERROR(r->status)) {
+                            if (conf->error_override
+                                && ap_is_HTTP_ERROR(r->status) && ap_is_initial_req(r)) {
                                 /*
                                  * set script_error_status to discard
                                  * everything after the headers