httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <>
Subject Re: mod_deflate handling of empty initial brigade
Date Wed, 02 Jun 2010 09:49:00 GMT
On Tue, Jun 01, 2010 at 05:02:08PM +0200, "Plüm, Rüdiger, VF-Group" wrote:
> > The guide to writing output filters says:
> > 
> >
> > 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

View raw message