]> granicus.if.org Git - apache/commitdiff
mod_deflate: Delay INFLATE input filter's self removal until all the buffered
authorYann Ylavic <ylavic@apache.org>
Tue, 15 Apr 2014 14:29:30 +0000 (14:29 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 15 Apr 2014 14:29:30 +0000 (14:29 +0000)
             buckets are out (including EOS). PR 46146.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1587594 13f79535-47bb-0310-9956-ffa450edef68

modules/filters/mod_deflate.c

index 96205f19701578a872b9682e8633b8a2939eafaa..2d9a5f147472cbcb98739512180a1bf98242172b 100644 (file)
@@ -1194,7 +1194,6 @@ static apr_status_t deflate_in_filter(ap_filter_t *f,
                 /* Move everything to the returning brigade. */
                 APR_BUCKET_REMOVE(bkt);
                 APR_BRIGADE_INSERT_TAIL(ctx->proc_bb, bkt);
-                ap_remove_input_filter(f);
                 break;
             }
 
@@ -1368,8 +1367,8 @@ static apr_status_t deflate_in_filter(ap_filter_t *f,
      * some data in our zlib buffer, flush it out so we can return something.
      */
     if (block == APR_BLOCK_READ &&
-        APR_BRIGADE_EMPTY(ctx->proc_bb) &&
-        ctx->stream.avail_out < c->bufferSize) {
+            APR_BRIGADE_EMPTY(ctx->proc_bb) &&
+            ctx->stream.avail_out < c->bufferSize) {
         apr_bucket *tmp_heap;
         apr_size_t len;
         ctx->stream.next_out = ctx->buffer;
@@ -1390,6 +1389,9 @@ static apr_status_t deflate_in_filter(ap_filter_t *f,
             APR_BRIGADE_CONCAT(bb, ctx->proc_bb);
             apr_brigade_split_ex(bb, bkt, ctx->proc_bb);
         }
+        if (APR_BUCKET_IS_EOS(APR_BRIGADE_LAST(bb))) {
+            ap_remove_input_filter(f);
+        }
     }
 
     return APR_SUCCESS;