Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 90809 invoked from network); 12 Aug 2004 21:27:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 12 Aug 2004 21:27:16 -0000 Received: (qmail 66479 invoked by uid 500); 12 Aug 2004 21:27:09 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 66443 invoked by uid 500); 12 Aug 2004 21:27:08 -0000 Mailing-List: contact dev-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 dev@httpd.apache.org Received: (qmail 66429 invoked by uid 99); 12 Aug 2004 21:27:08 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received: from [128.195.24.168] (HELO scotch.ics.uci.edu) (128.195.24.168) by apache.org (qpsmtpd/0.27.1) with ESMTP; Thu, 12 Aug 2004 14:27:07 -0700 Received: from mvata-64-75.cruznet.ucsc.edu (scotch.ics.uci.edu [128.195.24.168]) (authenticated bits=0) by scotch.ics.uci.edu (8.12.6/8.12.6) with ESMTP id i7CLR22q015246 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 12 Aug 2004 14:27:04 -0700 (PDT) Date: Thu, 12 Aug 2004 14:27:03 -0700 From: Justin Erenkrantz To: dev@httpd.apache.org Subject: Re: BRIGADE_NORMALIZE is bad coding example Message-ID: <71E36ACBABC5BBC6778F461B@mvata-64-75.cruznet.ucsc.edu> In-Reply-To: <20040812210310.GA16499@netspace.org> References: <20040812210310.GA16499@netspace.org> X-Mailer: Mulberry/3.1.5 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Spam-Status: No, score=-0.1 required=5.0 tests=ALL_TRUSTED autolearn=failed version=3.0.0-pre1-r21475 X-Spam-Checker-Version: SpamAssassin 3.0.0-pre1-r21475 (2004-06-19) on scotch.ics.uci.edu X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --On Thursday, August 12, 2004 5:03 PM -0400 Glenn Strauss wrote: > BRIGADE_NORMALIZE skips the bucket after a 0-length bucket. > In doing so, it might skip a 0-length bucket following it. If the last IMHO, the cleanest correct fix is to just add an else clause. At the cost of more variables, you could always use d and forgo the else clause, but I think that'll just confuse readers of the macro even more. We also can't accept C99 extensions. *shrug* We probably never hit this odd corner case in practice though because core_input_filter only has one of the following: one empty bucket, one socket bucket, one heap bucket, or a heap and a socket bucket: two empty buckets won't happen due to the design. FWIW, BRIGADE_NORMALIZE was thrown out of apr-util because it was really bad to begin with: hence the comment ("This is bad.") and the localization of it to only server/core.c. It was never meant to be an example - yet, this is a minor bug more than anything serious. -- justin