From: Justin Erenkrantz Date: Sun, 20 Jan 2002 11:37:07 +0000 (+0000) Subject: Add AP_MODE_SPECULATIVE support to core_input_filter X-Git-Tag: 2.0.31~135 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e39ae2098dfee676a1728e7f51e4b28250f057b0;p=apache Add AP_MODE_SPECULATIVE support to core_input_filter git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92943 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/core.c b/server/core.c index ab9bca873c..19c05c7495 100644 --- a/server/core.c +++ b/server/core.c @@ -3115,7 +3115,7 @@ static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, return APR_SUCCESS; } /* read up to the amount they specified. */ - if (mode == AP_MODE_READBYTES) { + if (mode == AP_MODE_READBYTES || mode == AP_MODE_SPECULATIVE) { apr_off_t total; apr_bucket *e; apr_bucket_brigade *newbb; @@ -3142,7 +3142,21 @@ static int core_input_filter(ap_filter_t *f, apr_bucket_brigade *b, /* Must do split before CONCAT */ newbb = apr_brigade_split(ctx->b, e); - APR_BRIGADE_CONCAT(b, ctx->b); + + if (mode == AP_MODE_READBYTES) { + APR_BRIGADE_CONCAT(b, ctx->b); + } + else if (mode == AP_MODE_SPECULATIVE) { + apr_bucket *copy_bucket; + APR_BRIGADE_FOREACH(e, ctx->b) { + rv = apr_bucket_copy(e, ©_bucket); + if (rv != APR_SUCCESS) { + return rv; + } + APR_BRIGADE_INSERT_TAIL(b, copy_bucket); + } + } + /* Take what was originally there and place it back on ctx->b */ APR_BRIGADE_CONCAT(ctx->b, newbb);