Return-Path: Delivered-To: apmail-apr-commits-archive@www.apache.org Received: (qmail 34049 invoked from network); 21 Jul 2007 17:42:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jul 2007 17:42:37 -0000 Received: (qmail 27598 invoked by uid 500); 21 Jul 2007 17:42:39 -0000 Delivered-To: apmail-apr-commits-archive@apr.apache.org Received: (qmail 27497 invoked by uid 500); 21 Jul 2007 17:42:38 -0000 Mailing-List: contact commits-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: dev@apr.apache.org List-Id: Delivered-To: mailing list commits@apr.apache.org Received: (qmail 27478 invoked by uid 99); 21 Jul 2007 17:42:38 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jul 2007 10:42:38 -0700 X-ASF-Spam-Status: No, hits=-99.5 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jul 2007 10:42:36 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id 2C25A1A981A; Sat, 21 Jul 2007 10:42:16 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r558361 - in /apr/apr-util/trunk: buckets/apr_brigade.c include/apr_buckets.h Date: Sat, 21 Jul 2007 17:42:15 -0000 To: commits@apr.apache.org From: davi@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070721174216.2C25A1A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: davi Date: Sat Jul 21 10:42:14 2007 New Revision: 558361 URL: http://svn.apache.org/viewvc?view=rev&rev=558361 Log: Make apr_brigade_length() always update the length parameter. In case of a bucket read error, return the length up to the error. PR: 40893 Modified: apr/apr-util/trunk/buckets/apr_brigade.c apr/apr-util/trunk/include/apr_buckets.h Modified: apr/apr-util/trunk/buckets/apr_brigade.c URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/buckets/apr_brigade.c?view=diff&rev=558361&r1=558360&r2=558361 ============================================================================== --- apr/apr-util/trunk/buckets/apr_brigade.c (original) +++ apr/apr-util/trunk/buckets/apr_brigade.c Sat Jul 21 10:42:14 2007 @@ -165,6 +165,7 @@ { apr_off_t total = 0; apr_bucket *bkt; + apr_status_t status = APR_SUCCESS; for (bkt = APR_BRIGADE_FIRST(bb); bkt != APR_BRIGADE_SENTINEL(bb); @@ -173,16 +174,15 @@ if (bkt->length == (apr_size_t)(-1)) { const char *ignore; apr_size_t len; - apr_status_t status; if (!read_all) { - *length = -1; - return APR_SUCCESS; + total = -1; + break; } if ((status = apr_bucket_read(bkt, &ignore, &len, APR_BLOCK_READ)) != APR_SUCCESS) { - return status; + break; } } Modified: apr/apr-util/trunk/include/apr_buckets.h URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/apr_buckets.h?view=diff&rev=558361&r1=558360&r2=558361 ============================================================================== --- apr/apr-util/trunk/include/apr_buckets.h (original) +++ apr/apr-util/trunk/include/apr_buckets.h Sat Jul 21 10:42:14 2007 @@ -712,8 +712,9 @@ * Return the total length of the brigade. * @param bb The brigade to compute the length of * @param read_all Read unknown-length buckets to force a size - * @param length Returns the length of the brigade, or -1 if the brigade has - * buckets of indeterminate length and read_all is 0. + * @param length Returns the length of the brigade (up to the end, or up + * to a bucket read error), or -1 if the brigade has buckets + * of indeterminate length and read_all is 0. */ APU_DECLARE(apr_status_t) apr_brigade_length(apr_bucket_brigade *bb, int read_all,