Return-Path: Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 55707 invoked by uid 500); 26 Nov 2001 09:05:43 -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 55696 invoked by uid 500); 26 Nov 2001 09:05:43 -0000 Delivered-To: apmail-httpd-2.0-cvs@apache.org Date: 26 Nov 2001 08:49:29 -0000 Message-ID: <20011126084929.21057.qmail@icarus.apache.org> From: brianp@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 brianp 01/11/26 00:49:29 Modified: server core.c Log: Another fix for the core_output_filter() code that concatenates small buckets: It's possible for the temporary brigade to contain more than one bucket. If this happens, we need to recover the buckets after the first from the temporary brigade before destroying it. Revision Changes Path 1.108 +9 -2 httpd-2.0/server/core.c Index: core.c =================================================================== RCS file: /home/cvs/httpd-2.0/server/core.c,v retrieving revision 1.107 retrieving revision 1.108 diff -u -r1.107 -r1.108 --- core.c 2001/11/26 07:21:48 1.107 +++ core.c 2001/11/26 08:49:29 1.108 @@ -3080,7 +3080,7 @@ if (!fd) { if (nvec == MAX_IOVEC_TO_WRITE) { /* woah! too many. buffer them up, for use later. */ - apr_bucket *temp; + apr_bucket *temp, *next; apr_bucket_brigade *temp_brig; temp_brig = apr_brigade_create(f->c->pool); @@ -3097,9 +3097,16 @@ temp = APR_BRIGADE_FIRST(temp_brig); APR_BUCKET_REMOVE(temp); APR_BRIGADE_INSERT_HEAD(b, temp); - apr_brigade_destroy(temp_brig); e = temp; last_e = e; + for (next = APR_BRIGADE_FIRST(temp_brig); + next != APR_BRIGADE_SENTINEL(temp_brig); + next = APR_BRIGADE_FIRST(temp_brig)) { + APR_BUCKET_REMOVE(next); + APR_BUCKET_INSERT_AFTER(temp, next); + temp = next; + } + apr_brigade_destroy(temp_brig); nvec = 0; apr_bucket_read(e, &str, &n, APR_BLOCK_READ); }