]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Remain compatible with legacy MPMs that passed NULL to the network filter
authorGraham Leggett <minfrin@apache.org>
Sun, 4 Oct 2015 10:41:27 +0000 (10:41 +0000)
committerGraham Leggett <minfrin@apache.org>
Sun, 4 Oct 2015 10:41:27 +0000 (10:41 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1706670 13f79535-47bb-0310-9956-ffa450edef68

server/core_filters.c

index 0f530f868ff645ce3476f56d6557b5607e23eaba..60194f28dbb5dbaa005fdf0bd46bbd6b1c358bde 100644 (file)
@@ -79,6 +79,7 @@ do { \
 
 struct core_output_filter_ctx {
     apr_bucket_brigade *tmp_flush_bb;
+    apr_bucket_brigade *empty_bb;
     apr_size_t bytes_written;
 };
 
@@ -382,6 +383,14 @@ apr_status_t ap_core_output_filter(ap_filter_t *f, apr_bucket_brigade *bb)
         ctx->tmp_flush_bb = apr_brigade_create(c->pool, c->bucket_alloc);
     }
 
+    /* remain compatible with legacy MPMs that passed NULL to this filter */
+    if (bb == NULL) {
+        if (ctx->empty_bb == NULL) {
+            ctx->empty_bb = apr_brigade_create(c->pool, c->bucket_alloc);
+        }
+        bb = ctx->empty_bb;
+    }
+
     /* Scan through the brigade and decide whether to attempt a write,
      * and how much to write, based on the following rules:
      *