Return-Path: X-Original-To: apmail-httpd-dev-archive@www.apache.org Delivered-To: apmail-httpd-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E494773D0 for ; Fri, 16 Sep 2011 14:44:16 +0000 (UTC) Received: (qmail 44224 invoked by uid 500); 16 Sep 2011 14:44:16 -0000 Delivered-To: apmail-httpd-dev-archive@httpd.apache.org Received: (qmail 44154 invoked by uid 500); 16 Sep 2011 14:44:16 -0000 Mailing-List: contact dev-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@httpd.apache.org Received: (qmail 44005 invoked by uid 99); 16 Sep 2011 14:44:09 -0000 Received: from minotaur.apache.org (HELO minotaur.apache.org) (140.211.11.9) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Sep 2011 14:44:09 +0000 Received: by minotaur.apache.org (Postfix, from userid 2161) id 8DAF673C5; Fri, 16 Sep 2011 14:44:09 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by euler.heimnetz.de (Postfix) with ESMTP id 5E22D24044 for ; Fri, 16 Sep 2011 16:45:59 +0200 (CEST) Message-ID: <4E736127.3090001@apache.org> Date: Fri, 16 Sep 2011 16:45:59 +0200 From: Ruediger Pluem User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.24) Gecko/20100301 SeaMonkey/1.1.19 MIME-Version: 1.0 To: dev@httpd.apache.org Subject: Re: svn commit: r1170330 - /httpd/httpd/trunk/modules/filters/mod_deflate.c References: <20110913201718.B036323888E4@eris.apache.org> In-Reply-To: <20110913201718.B036323888E4@eris.apache.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 09/13/2011 10:17 PM, sf@apache.org wrote: > Author: sf > Date: Tue Sep 13 20:17:18 2011 > New Revision: 1170330 > > URL: http://svn.apache.org/viewvc?rev=1170330&view=rev > Log: > Fix 'Content-Encoding: gzip' missing if the first brigade passed to > deflate_out_buffer contained zero data bytes but no EOS bucket. > > Don't compress if the added headers and checksums are larger than > the data to compress (and we know the size of the data in advance). > > 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=1170330&r1=1170329&r2=1170330&view=diff > ============================================================================== > --- httpd/httpd/trunk/modules/filters/mod_deflate.c (original) > +++ httpd/httpd/trunk/modules/filters/mod_deflate.c Tue Sep 13 20:17:18 2011 > @@ -426,7 +426,7 @@ static apr_status_t deflate_out_filter(a > request_rec *r = f->r; > deflate_ctx *ctx = f->ctx; > int zRC; > - apr_size_t len; > + apr_size_t len = 0, blen; > const char *data; > deflate_filter_config *c; > > @@ -448,28 +448,41 @@ static apr_status_t deflate_out_filter(a > char *token; > const char *encoding; > > - /* Delay initialization until we have seen some data */ > - e = APR_BRIGADE_FIRST(bb); > - while (1) { > - apr_status_t rc; > - if (e == APR_BRIGADE_SENTINEL(bb)) > - return ap_pass_brigade(f->next, bb); > - if (APR_BUCKET_IS_EOS(e)) { > - ap_remove_output_filter(f); > - return ap_pass_brigade(f->next, bb); > - } > - if (APR_BUCKET_IS_METADATA(e)) { > - e = APR_BUCKET_NEXT(e); > - continue; > - } > + e = APR_BRIGADE_LAST(bb); > + if (APR_BUCKET_IS_EOS(e)) { Does this work if e is the the sentinel (in case of an empty brigade)? Regards RĂ¼diger