httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r724515 - /httpd/httpd/trunk/modules/http/http_request.c
Date Mon, 08 Dec 2008 22:18:27 GMT
Author: rpluem
Date: Mon Dec  8 14:18:27 2008
New Revision: 724515

URL: http://svn.apache.org/viewvc?rev=724515&view=rev
Log:
* Correctly remove the SUBREQ_CORE filter from the filter chain if we do an
  internal fast redirect and if the new redirected request is NO subrequest.
  This fixes at least one of the possible subtle issues mentioned in the
  comment to r620133.

Modified:
    httpd/httpd/trunk/modules/http/http_request.c

Modified: httpd/httpd/trunk/modules/http/http_request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_request.c?rev=724515&r1=724514&r2=724515&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_request.c (original)
+++ httpd/httpd/trunk/modules/http/http_request.c Mon Dec  8 14:18:27 2008
@@ -522,9 +522,26 @@
         ap_add_output_filter_handle(ap_subreq_core_filter_handle,
                                     NULL, r, r->connection);
     }
-    else if (r->output_filters->frec == ap_subreq_core_filter_handle) {
-        ap_remove_output_filter(r->output_filters);
-        r->output_filters = r->output_filters->next;
+    else {
+        /*
+         * We need to check if we now have the SUBREQ_CORE filter in our filter
+         * chain. If this is the case we need to remove it since we are NO
+         * subrequest. But we need to keep in mind that the SUBREQ_CORE filter
+         * does not necessarily need to be the first filter in our chain. So we
+         * need to go through the chain. But we only need to walk up the chain
+         * until the proto_output_filters as the SUBREQ_CORE filter is below the
+         * protocol filters.
+         */
+        ap_filter_t *next;
+
+        next = r->output_filters;
+        while (next && (next->frec != ap_subreq_core_filter_handle)
+               && (next != r->proto_output_filters)) {
+                next = next->next;
+        }
+        if (next && (next->frec == ap_subreq_core_filter_handle)) {
+            ap_remove_output_filter(next);
+        }
     }
 
     /* If any filters pointed at the now-defunct rr, we must point them



Mime
View raw message