httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 17629] filter handling issues with subrequests and internal redirects
Date Sun, 23 May 2010 09:01:39 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=17629

--- Comment #36 from Stefan Priebe <stefan@priebe.ws> 2010-05-23 05:01:32 EDT ---
I'm using this patch to address this issue it is working fine.

--- http/http_request.c 2006-07-12 05:38:44.000000000 +0200
+++ ../http_request.c   2006-10-07 19:29:33.000000000 +0200
@@ -374,17 +374,27 @@ static request_rec *internal_internal_re
     new->proto_output_filters  = r->proto_output_filters;
     new->proto_input_filters   = r->proto_input_filters;

-    new->output_filters  = new->proto_output_filters;
-    new->input_filters   = new->proto_input_filters;
-
     if (new->main) {
+        new->output_filters = r->output_filters;
+        new->input_filters = r->input_filters;
+
         /* Add back the subrequest filter, which we lost when
          * we set output_filters to include only the protocol
          * output filters from the original request.
+         *
+         * XXX: This shouldn't be neccessary any longer, because the filter
+         * is still in place -- isn't it?
          */
         ap_add_output_filter_handle(ap_subreq_core_filter_handle,
                                     NULL, new, new->connection);
     }
+    else {
+        /* In subrequests we _must_ point to the complete upper request's
+         * filter chain, so skip the filters _only_ within the main request.
+         */
+        new->output_filters  = new->proto_output_filters;
+        new->input_filters   = new->proto_input_filters;
+    }

     update_r_in_filters(new->input_filters, r, new);
     update_r_in_filters(new->output_filters, r, new);
@@ -438,10 +448,19 @@ AP_DECLARE(void) ap_internal_fast_redire
     r->subprocess_env = apr_table_overlay(r->pool, rr->subprocess_env,
                                           r->subprocess_env);

-    r->output_filters = rr->output_filters;
-    r->input_filters = rr->input_filters;
+    /* copy the filters _only_ within the main request. In subrequests
+     * we _must_ point to the upper requests' filter chain, so do not
+     * touch 'em!
+     */
+    if (!r->main) {
+        r->output_filters = rr->output_filters;
+        r->input_filters = rr->input_filters;
+    }

     if (r->main) {
+        /* XXX: This shouldn't be neccessary any longer, because the filter
+         * is still in place -- isn't it?
+         */
         ap_add_output_filter_handle(ap_subreq_core_filter_handle,
                                     NULL, r, r->connection);
     }

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


Mime
View raw message