From: Jeff Trawick Date: Wed, 6 Feb 2002 16:16:55 +0000 (+0000) Subject: yet another tweak to empty brigade checking on entry to core_input_filter(): X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=60cbb9ea608107feadeee793828380fb6eceaafb;p=apache 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 --- 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