Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 69774 invoked by uid 500); 30 Sep 2002 01:57:57 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 69763 invoked by uid 500); 30 Sep 2002 01:57:57 -0000 Delivered-To: apmail-apr-util-cvs@apache.org Date: 30 Sep 2002 01:57:56 -0000 Message-ID: <20020930015756.42518.qmail@icarus.apache.org> From: brianp@apache.org To: apr-util-cvs@apache.org Subject: cvs commit: apr-util/buckets apr_brigade.c X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N brianp 2002/09/29 18:57:56 Modified: buckets apr_brigade.c Log: In apr_brigade_writev(), create heap buckets instead of transient buckets if there is no flush function. (Thanks to Greg Stein for catching this.) Revision Changes Path 1.54 +13 -6 apr-util/buckets/apr_brigade.c Index: apr_brigade.c =================================================================== RCS file: /home/cvs/apr-util/buckets/apr_brigade.c,v retrieving revision 1.53 retrieving revision 1.54 diff -u -r1.53 -r1.54 --- apr_brigade.c 29 Sep 2002 01:05:37 -0000 1.53 +++ apr_brigade.c 30 Sep 2002 01:57:55 -0000 1.54 @@ -470,19 +470,26 @@ total_len += vec[i].iov_len; } - /* If the data to be written is very large, convert + /* If the data to be written is very large, try to convert * the iovec to transient buckets rather than copying. */ if (total_len > APR_BUCKET_BUFF_SIZE) { - for (i = 0; i < nvec; i++) { - e = apr_bucket_transient_create(vec[i].iov_base, vec[i].iov_len, - b->bucket_alloc); - APR_BRIGADE_INSERT_TAIL(b, e); - } if (flush) { + for (i = 0; i < nvec; i++) { + e = apr_bucket_transient_create(vec[i].iov_base, + vec[i].iov_len, + b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } return flush(b, ctx); } else { + for (i = 0; i < nvec; i++) { + e = apr_bucket_heap_create((const char *) vec[i].iov_base, + vec[i].iov_len, NULL, + b->bucket_alloc); + APR_BRIGADE_INSERT_TAIL(b, e); + } return APR_SUCCESS; } }