Return-Path: Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: (qmail 72883 invoked from network); 2 Jun 2010 09:49:35 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 2 Jun 2010 09:49:35 -0000 Received: (qmail 8186 invoked by uid 500); 2 Jun 2010 09:49:35 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 8108 invoked by uid 500); 2 Jun 2010 09:49:35 -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: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 8099 invoked by uid 99); 2 Jun 2010 09:49:34 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 09:49:34 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=10.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jorton@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jun 2010 09:49:26 +0000 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o529n3cC026808 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 2 Jun 2010 05:49:03 -0400 Received: from turnip.manyfish.co.uk (vpn-10-87.rdu.redhat.com [10.11.10.87]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o529n1Et015207 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Wed, 2 Jun 2010 05:49:03 -0400 Received: from jorton by turnip.manyfish.co.uk with local (Exim 4.69) (envelope-from ) id 1OJkZJ-0003nU-29 for dev@httpd.apache.org; Wed, 02 Jun 2010 10:49:01 +0100 Date: Wed, 2 Jun 2010 10:49:00 +0100 From: Joe Orton To: dev@httpd.apache.org Subject: Re: mod_deflate handling of empty initial brigade Message-ID: <20100602094900.GA14557@redhat.com> Mail-Followup-To: dev@httpd.apache.org References: <99EA83DCDE961346AFA9B5EC33FEC08B04003512@VF-MBX11.internal.vodafone.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <99EA83DCDE961346AFA9B5EC33FEC08B04003512@VF-MBX11.internal.vodafone.com> User-Agent: Mutt/1.5.20 (2009-08-17) Organization: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, United Kingdom. Registered in UK and Wales under Company Registration No. 03798903 Directors: Michael Cunningham (USA), Brendan Lane (Ireland), Matt Parson (USA), Charlie Peters (USA) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-Virus-Checked: Checked by ClamAV on apache.org On Tue, Jun 01, 2010 at 05:02:08PM +0200, "Plüm, Rüdiger, VF-Group" wrote: > > The guide to writing output filters says: > > > > https://httpd.apache.org/docs/trunk/developer/output-filters.h > > tml#invocation > > > > "An output filter should never pass an empty brigade down the filter > > chain. But, for good defensive programming, filters should be prepared > > to accept an empty brigade, and do nothing." > > IMHO do nothing means the same thing as pass it down the chain. So I think > mod_deflate does the correct thing here. The wording there is not entirely clear but I think the intent matches the example, as Matthew points out. On the general point, is there a reason to prefer having filters pass down empty brigades rather than ignore them and return success? Other than burning a few cycles, it does seem less safe since a less defensive downstream filter (e.g. the core output filter in this example!) may "do something" given the empty brigade. Maybe we should have a strict API here rather than a loose one: "filters MUST NOT pass an empty brigade down the filter chain." Regards, Joe