httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: svn commit: r554011 - /httpd/httpd/trunk/modules/filters/mod_deflate.c
Date Sat, 07 Jul 2007 20:13:08 GMT


On 07/06/2007 09:36 PM, gregames@apache.org wrote:
> Author: gregames
> Date: Fri Jul  6 12:36:30 2007
> New Revision: 554011
> 
> URL: http://svn.apache.org/viewvc?view=rev&rev=554011
> Log:
> with LimitRequestBody xxx and the deflate output filter configured, mod_deflate
> eats the 413 error bucket, a 500 error is logged, and a blank screen appears
> at the browser.
> 
> 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?view=diff&rev=554011&r1=554010&r2=554011
> ==============================================================================
> --- httpd/httpd/trunk/modules/filters/mod_deflate.c (original)
> +++ httpd/httpd/trunk/modules/filters/mod_deflate.c Fri Jul  6 12:36:30 2007
> @@ -44,6 +44,7 @@
>  #include "http_request.h"
>  #define APR_WANT_STRFUNC
>  #include "apr_want.h"
> +#include "http_protocol.h"
>  
>  #include "zlib.h"
>  
> @@ -576,6 +577,11 @@
>                  return rv;
>              }
>              continue;
> +        }
> +
> +        if (AP_BUCKET_IS_ERROR(e)) {
> +            ap_remove_output_filter(f);
> +            return ap_pass_brigade(f->next, bb);
>          }
>  
>          /* read */


Two comments:

1. IMHO this does not work well if a proxy backend breaks in the middle of the response and
sends
   an error bucket up the chain (ap_proxy_backend_broke). This can lead to a mixture of uncompressed
   and compressed content in the response and a correct partial response might be valuable
for
   the client in order to continue the connection where it broke with a range request.

2. In principle the inflate output filter suffers from the same problem.

The following patch should address both points. Comments?

Index: modules/filters/mod_deflate.c
===================================================================
--- modules/filters/mod_deflate.c       (Revision 554244)
+++ modules/filters/mod_deflate.c       (Arbeitskopie)
@@ -579,9 +579,14 @@
             continue;
         }

-        if (AP_BUCKET_IS_ERROR(e)) {
-            ap_remove_output_filter(f);
-            return ap_pass_brigade(f->next, bb);
+        if (APR_BUCKET_IS_METADATA(e)) {
+            /*
+             * Remove meta data bucket from old brigade and insert into the
+             * new.
+             */
+            APR_BUCKET_REMOVE(e);
+            APR_BRIGADE_INSERT_TAIL(ctx->bb, e);
+            continue;
         }

         /* read */
@@ -1087,6 +1092,16 @@
             continue;
         }

+        if (APR_BUCKET_IS_METADATA(e)) {
+            /*
+             * Remove meta data bucket from old brigade and insert into the
+             * new.
+             */
+            APR_BUCKET_REMOVE(e);
+            APR_BRIGADE_INSERT_TAIL(ctx->bb, e);
+            continue;
+        }
+
         /* read */
         apr_bucket_read(e, &data, &len, APR_BLOCK_READ);


Regards

RĂ¼diger


Mime
View raw message