From: Aaron Bannert Date: Wed, 6 Mar 2002 18:03:19 +0000 (+0000) Subject: Fix a bug in the APR_MODE_EXHAUSTIVE mode for the core input filter. X-Git-Tag: CHANGES~227 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fce3fb447025800d8f31b439dd4ca81b6b5d5378;p=thirdparty%2Fapache%2Fhttpd.git Fix a bug in the APR_MODE_EXHAUSTIVE mode for the core input filter. This patch changes nothing outside of that mode. Also, why do we ever call apr_brigade_length() in the core? This doesn't seem right to me, so here's a comment above the other call. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93736 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/core.c b/server/core.c index 4f95f37c205..7d95e1f0299 100644 --- a/server/core.c +++ b/server/core.c @@ -3389,11 +3389,13 @@ static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, */ if (mode == AP_MODE_EXHAUSTIVE) { apr_bucket *e; - apr_off_t total; - /* Force a recompute of the length and force a read-all */ - apr_brigade_length(ctx->b, 1, &total); + /* Tack on any buckets that were set aside. */ APR_BRIGADE_CONCAT(b, ctx->b); + + /* Since we've just added all potential buckets (which will most + * likely simply be the socket bucket) we know this is the end, + * so tack on an EOS too. */ /* We have read until the brigade was empty, so we know that we * must be EOS. */ e = apr_bucket_eos_create(); @@ -3463,6 +3465,7 @@ static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, /* Take what was originally there and place it back on ctx->b */ APR_BRIGADE_CONCAT(ctx->b, newbb); + /* XXX: Why is this here? We never use 'total'! */ apr_brigade_length(b, 1, &total); return APR_SUCCESS;