Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 39893 invoked by uid 500); 20 Jan 2002 11:37:08 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 39882 invoked by uid 500); 20 Jan 2002 11:37:08 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 20 Jan 2002 11:37:08 -0000 Message-ID: <20020120113708.33380.qmail@icarus.apache.org> From: jerenkrantz@apache.org To: httpd-2.0-cvs@apache.org Subject: cvs commit: httpd-2.0/server core.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N jerenkrantz 02/01/20 03:37:07 Modified: server core.c Log: Add AP_MODE_SPECULATIVE support to core_input_filter Revision Changes Path 1.132 +16 -2 httpd-2.0/server/core.c Index: core.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/core.c,v retrieving revision 1.131 retrieving revision 1.132 diff -u -r1.131 -r1.132 --- core.c 19 Jan 2002 07:45:18 -0000 1.131 +++ core.c 20 Jan 2002 11:37:07 -0000 1.132 @@ -3115,7 +3115,7 @@ 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 @@ /* 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);