From: Jeff Trawick Date: Thu, 2 Nov 2000 15:42:56 +0000 (+0000) Subject: ap_http_header_filter() can't remove itself until after we the X-Git-Tag: APACHE_2_0_ALPHA_8~195 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7bf310d027265f74d95b3a6a027cb867f058a1ff;p=apache ap_http_header_filter() can't remove itself until after we the CHUNK filter has been added. Otherwise, f->next won't be the CHUNK filter and thus the first brigade won't be chunked properly. Reported by: wrowe git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@86799 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/http/http_protocol.c b/modules/http/http_protocol.c index d592d6d8b4..6e0f0727c3 100644 --- a/modules/http/http_protocol.c +++ b/modules/http/http_protocol.c @@ -2436,7 +2436,6 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f, ap_bu b2 = ap_brigade_create(r->pool); e = ap_bucket_create_pool(buff_start, strlen(buff_start), r->pool); AP_BRIGADE_INSERT_HEAD(b2, e); - ap_remove_output_filter(f); ap_pass_brigade(f->next, b2); if (r->chunked) { @@ -2447,6 +2446,11 @@ AP_CORE_DECLARE_NONSTD(apr_status_t) ap_http_header_filter(ap_filter_t *f, ap_bu ap_add_output_filter("CHUNK", NULL, r, r->connection); } + /* Don't remove this filter until after we have added the CHUNK filter. + * Otherwise, f->next won't be the CHUNK filter and thus the first + * brigade won't be chunked properly. + */ + ap_remove_output_filter(f); return ap_pass_brigade(f->next, b); }