httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Plüm, Rüdiger, VF-Group" <ruediger.pl...@vodafone.com>
Subject RE: mod_deflate handling of empty initial brigade
Date Wed, 02 Jun 2010 10:36:07 GMT
 

> -----Original Message-----
> From: Joe Orton
> Sent: Mittwoch, 2. Juni 2010 11:49
> To: dev@httpd.apache.org
> Subject: Re: mod_deflate handling of empty initial brigade
> 
> 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."

+1 on clarifying the documentation. I am fine with the approach
if it is documented (and I think it is. I was only too lazy to read
it again until I got the link, hence my impression was wrong).
I think in general a filter should pass along all buckets it doesn't
care / know to handle because some downstream filter might be able
to do this. But I agree that empty brigades do not fall into this category
and I have no concrete example at hand where an empty brigade does
mean something to the downstream filter.
Anyway if this is the case we should rather create another meta bucket
type instead to achieve the same thing.


Regards

Rüdiger



Mime
View raw message