]> granicus.if.org Git - apache/commitdiff
ap_http_header_filter() can't remove itself until after we the
authorJeff Trawick <trawick@apache.org>
Thu, 2 Nov 2000 15:42:56 +0000 (15:42 +0000)
committerJeff Trawick <trawick@apache.org>
Thu, 2 Nov 2000 15:42:56 +0000 (15:42 +0000)
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

modules/http/http_protocol.c

index d592d6d8b4a7877a6ca5dcf2c487e3bdb95463b0..6e0f0727c3c34c087ccb9708806a2bc93bd7f203 100644 (file)
@@ -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);
 }