httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matthew Steele <>
Subject Re: mod_deflate handling of empty initial brigade
Date Tue, 01 Jun 2010 15:14:16 GMT
On Tue, Jun 1, 2010 at 11:02 AM, "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.

On the contrary, the link above specifically recommends putting the
following code snippet at the top of your output filter to suppress
the empty brigade (rather than pass it along to the next filter):

apr_status_t dummy_filter(ap_filter_t *f, apr_bucket_brigade *bb)
   if (APR_BRIGADE_EMPTY(bb)) {
      return APR_SUCCESS;

Does anyone know whether or not this is the right thing to do?


View raw message