You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by rp...@apache.org on 2006/07/23 17:50:09 UTC

svn commit: r424759 - /httpd/httpd/trunk/modules/filters/mod_deflate.c

Author: rpluem
Date: Sun Jul 23 08:50:08 2006
New Revision: 424759

URL: http://svn.apache.org/viewvc?rev=424759&view=rev
Log:
* This shortcut is too short. It is not up to the filters to decide
  whether filters down the chain can do something useful with this empty
  brigade.

Modified:
    httpd/httpd/trunk/modules/filters/mod_deflate.c

Modified: httpd/httpd/trunk/modules/filters/mod_deflate.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_deflate.c?rev=424759&r1=424758&r2=424759&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_deflate.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_deflate.c Sun Jul 23 08:50:08 2006
@@ -263,7 +263,7 @@
 
     /* Do nothing if asked to filter nothing. */
     if (APR_BRIGADE_EMPTY(bb)) {
-        return APR_SUCCESS;
+        return ap_pass_brigade(f->next, bb);
     }
 
     /* If we don't have a context, we need to ensure that it is okay to send
@@ -878,7 +878,7 @@
 
     /* Do nothing if asked to filter nothing. */
     if (APR_BRIGADE_EMPTY(bb)) {
-        return APR_SUCCESS;
+        return ap_pass_brigade(f->next, bb);
     }
 
     c = ap_get_module_config(r->server->module_config, &deflate_module);



Re: svn commit: r424759 - /httpd/httpd/trunk/modules/filters/mod_deflate.c

Posted by Ruediger Pluem <rp...@apache.org>.

On 07/23/2006 08:47 PM, Nick Kew wrote:
> On Sunday 23 July 2006 16:50, rpluem@apache.org wrote:
> 
>>Author: rpluem
>>Date: Sun Jul 23 08:50:08 2006
>>New Revision: 424759
>>
>>URL: http://svn.apache.org/viewvc?rev=424759&view=rev
>>Log:
>>* This shortcut is too short. It is not up to the filters to decide
>>  whether filters down the chain can do something useful with this empty
>>  brigade.
> 
> 
> Erm, why?  Brigades have no significance *per se*, and filters are always
> free to create, delete or otherwise manipulate them within certain basic
> rules.  Where's the problem with dropping an empty brigade?

Just out of curiosity: Do we have these basic rules somewhere?
The problem with dropping the empty brigade is that the filter assumes that because
the brigade is not useful for it, it is not useful for anyone. That is different
from manipulating a brigade in a certain way to reach the goal the filter was
designed for. The basic rule for filters that I take from the code is:

If I cannot do anything useful with this brigade for whatever reason simply pass it down
the chain and return whatever returns.

To be more precise this was one of the
causes for PR40090 (http://issues.apache.org/bugzilla/show_bug.cgi?id=40090).
Although I proposed a different fix for this PR, because I think that mod_cache
misbehaves in this case, I think that mod_deflate also misbehaves here.

Regards

RĂ¼diger

Re: svn commit: r424759 - /httpd/httpd/trunk/modules/filters/mod_deflate.c

Posted by Nick Kew <ni...@webthing.com>.
On Sunday 23 July 2006 16:50, rpluem@apache.org wrote:
> Author: rpluem
> Date: Sun Jul 23 08:50:08 2006
> New Revision: 424759
>
> URL: http://svn.apache.org/viewvc?rev=424759&view=rev
> Log:
> * This shortcut is too short. It is not up to the filters to decide
>   whether filters down the chain can do something useful with this empty
>   brigade.

Erm, why?  Brigades have no significance *per se*, and filters are always
free to create, delete or otherwise manipulate them within certain basic
rules.  Where's the problem with dropping an empty brigade?

>      /* Do nothing if asked to filter nothing. */
>      if (APR_BRIGADE_EMPTY(bb)) {
> -        return APR_SUCCESS;
> +        return ap_pass_brigade(f->next, bb);

-- 
Nick Kew