From: Graham Leggett Date: Sun, 4 Oct 2015 10:41:27 +0000 (+0000) Subject: Remain compatible with legacy MPMs that passed NULL to the network filter X-Git-Tag: 2.5.0-alpha~2763 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08f72dc2c0e8b13a4b3009217e675f0a13538ec3;p=thirdparty%2Fapache%2Fhttpd.git Remain compatible with legacy MPMs that passed NULL to the network filter git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1706670 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/core_filters.c b/server/core_filters.c index 0f530f868ff..60194f28dbb 100644 --- a/server/core_filters.c +++ b/server/core_filters.c @@ -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: *