stoddard 2003/05/16 07:11:41
Modified: modules/http Tag: APACHE_2_0_BRANCH http_request.c
Log:
Do not bypass output filters when redirecting subrequests internally.
PR: 17629 (Port of nd's patch from Apache 2.1)
Revision Changes Path
No revision
No revision
1.152.2.3 +24 -5 httpd-2.0/modules/http/http_request.c
Index: http_request.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/http/http_request.c,v
retrieving revision 1.152.2.2
retrieving revision 1.152.2.3
diff -u -r1.152.2.2 -r1.152.2.3
--- http_request.c 12 Mar 2003 18:24:26 -0000 1.152.2.2
+++ http_request.c 16 May 2003 14:11:40 -0000 1.152.2.3
@@ -394,17 +394,27 @@
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);
@@ -455,10 +465,19 @@
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);
}
|