From 60cbb9ea608107feadeee793828380fb6eceaafb Mon Sep 17 00:00:00 2001 From: Jeff Trawick Date: Wed, 6 Feb 2002 16:16:55 +0000 Subject: [PATCH] yet another tweak to empty brigade checking on entry to core_input_filter(): since APR_BRIGADE_EMPTY() assumes a non-empty brigade, we have to check before invoking that macro since APR_BRIGADE_EMPTY() can make a brigade empty, we have to check after invoking that macro An obvious variation of this fix would be to change APR_BRIGADE_NORMALIZE() to deal with empty brigades. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93293 13f79535-47bb-0310-9956-ffa450edef68 --- server/core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/core.c b/server/core.c index 8dc7ff2308..c55e114ac4 100644 --- a/server/core.c +++ b/server/core.c @@ -3058,11 +3058,14 @@ static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, APR_BRIGADE_INSERT_TAIL(ctx->b, e); net->in_ctx = ctx; } - + else if (APR_BRIGADE_EMPTY(ctx->b)) { + return APR_EOF; + } + /* ### This is bad. */ APR_BRIGADE_NORMALIZE(ctx->b); - /* check for empty brigade *AFTER* APR_BRIGADE_NORMALIZE() + /* check for empty brigade again *AFTER* APR_BRIGADE_NORMALIZE() * If we have lost our socket bucket (see above), we are EOF. * * Ideally, this should be returning SUCCESS with EOS bucket, but -- 2.40.0