From: Yann Ylavic Date: Sun, 29 Apr 2018 22:11:04 +0000 (+0000) Subject: mod_xml2enc: follow up to r1829038 and r1829039. X-Git-Tag: 2.5.0-alpha2-ci-test-only~2646 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55293364e9a864053cff852bd5cc8a9f31132e35;p=thirdparty%2Fapache%2Fhttpd.git mod_xml2enc: follow up to r1829038 and r1829039. Use below pending_data logic for EOS bucket. This closes #48 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1830523 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/filters/mod_xml2enc.c b/modules/filters/mod_xml2enc.c index be07237d901..2d7daecc90b 100644 --- a/modules/filters/mod_xml2enc.c +++ b/modules/filters/mod_xml2enc.c @@ -397,24 +397,21 @@ static apr_status_t xml2enc_ffunc(ap_filter_t* f, apr_bucket_brigade* bb) /* move the data back to bb */ APR_BRIGADE_CONCAT(bb, ctx->bbsave); - while (b = APR_BRIGADE_FIRST(bb), b != APR_BRIGADE_SENTINEL(bb)) { + while (!APR_BRIGADE_EMPTY(bb)) { + b = APR_BRIGADE_FIRST(bb); ctx->bytes = 0; if (APR_BUCKET_IS_METADATA(b)) { APR_BUCKET_REMOVE(b); APR_BRIGADE_INSERT_TAIL(ctx->bbnext, b); - /* This resource filter is over on EOS */ + /* Besides FLUSH, aggregate meta buckets to send them at + * once below. This resource filter is over on EOS. + */ + pending_meta = 1; if (APR_BUCKET_IS_EOS(b)) { ap_remove_output_filter(f); APR_BRIGADE_CONCAT(ctx->bbnext, bb); - rv = ap_pass_brigade(f->next, ctx->bbnext); - apr_brigade_cleanup(ctx->bbnext); - return rv; } - /* Besides FLUSH, aggregate meta buckets to send - * them at once below. - */ - pending_meta = 1; - if (!APR_BUCKET_IS_FLUSH(b)) { + else if (!APR_BUCKET_IS_FLUSH(b)) { continue; } }