From d81fdd8ce764dcc94eb81e0fb8f7153a0821c5b1 Mon Sep 17 00:00:00 2001 From: Jim Jagielski Date: Thu, 8 Mar 2012 16:09:43 +0000 Subject: [PATCH] Merge r1293717 from trunk: Pass the EOS bucket down the filter chain PR: 52766 Submitted by: sf Reviewed/backported by: jim git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1298451 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ STATUS | 7 ------- modules/filters/mod_xml2enc.c | 3 ++- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/CHANGES b/CHANGES index da5002a7b8..bea7ade6b1 100644 --- a/CHANGES +++ b/CHANGES @@ -2,6 +2,9 @@ Changes with Apache 2.4.2 + *) mod_xml2enc: Fix broken handling of EOS buckets which could lead to + response headers not being sent. PR 52766. [Stefan Fritsch] + *) mod_ssl: Properly free the GENERAL_NAMEs. PR 32652. *) core: Check during config test that directories for the access diff --git a/STATUS b/STATUS index 56317e3846..440ec41406 100644 --- a/STATUS +++ b/STATUS @@ -89,13 +89,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] -* mod_xml2enc: Fix handling of EOS buckets. - Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1293717 - 2.4.x patch: Trunk patch works, needs CHANGES entry: - mod_xml2enc: Fix broken handling of EOS buckets which could lead to - response headers not being sent. PR 52766. [Stefan Fritsch] - +1: sf, covener, jim - * envvars: Fix handling of LD_LIBRARY_PATH. CVE-2012-0883 Trunk patch: http://svn.apache.org/viewvc?view=revision&revision=1296428 2.4.x patch: Trunk patch works diff --git a/modules/filters/mod_xml2enc.c b/modules/filters/mod_xml2enc.c index 5b082fb431..f82f8bf50b 100644 --- a/modules/filters/mod_xml2enc.c +++ b/modules/filters/mod_xml2enc.c @@ -392,13 +392,14 @@ static apr_status_t xml2enc_ffunc(ap_filter_t* f, apr_bucket_brigade* bb) while (b = APR_BRIGADE_FIRST(bb), b != APR_BRIGADE_SENTINEL(bb)) { ctx->bytes = 0; if (APR_BUCKET_IS_METADATA(b)) { + APR_BUCKET_REMOVE(b); if (APR_BUCKET_IS_EOS(b)) { /* send remaining data */ + APR_BRIGADE_INSERT_TAIL(ctx->bbnext, b); return ap_fflush(f->next, ctx->bbnext); } else if (APR_BUCKET_IS_FLUSH(b)) { ap_fflush(f->next, ctx->bbnext); } - APR_BUCKET_REMOVE(b); apr_bucket_destroy(b); } else { /* data bucket */ -- 2.40.0