Return-Path: Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: (qmail 42887 invoked from network); 6 Aug 2007 14:38:05 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Aug 2007 14:38:05 -0000 Received: (qmail 44056 invoked by uid 500); 6 Aug 2007 14:38:03 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 44017 invoked by uid 500); 6 Aug 2007 14:38:03 -0000 Mailing-List: contact cvs-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 cvs@httpd.apache.org Received: (qmail 44006 invoked by uid 99); 6 Aug 2007 14:38:03 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2007 07:38:03 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 06 Aug 2007 14:38:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1FC8A1A981D; Mon, 6 Aug 2007 07:37:43 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r563154 - /httpd/httpd/trunk/modules/filters/mod_deflate.c Date: Mon, 06 Aug 2007 14:37:43 -0000 To: cvs@httpd.apache.org From: niq@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20070806143743.1FC8A1A981D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: niq Date: Mon Aug 6 07:37:42 2007 New Revision: 563154 URL: http://svn.apache.org/viewvc?view=rev&rev=563154 Log: Don't try to compress/decompress where there's a Content-Range. According to RFC2616, the range would have to apply *after* applying content-encoding, so anything that's been set before running the deflate filter is going to be broken. 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=563154&r1=563153&r2=563154 ============================================================================== --- httpd/httpd/trunk/modules/filters/mod_deflate.c (original) +++ httpd/httpd/trunk/modules/filters/mod_deflate.c Mon Aug 6 07:37:42 2007 @@ -387,6 +387,12 @@ return ap_pass_brigade(f->next, bb); } + /* We can't operate on Content-Ranges */ + if (apr_table_get(r->headers_out, "Content-Range") != NULL) { + ap_remove_output_filter(f); + return ap_pass_brigade(f->next, bb); + } + /* Some browsers might have problems with content types * other than text/html, so set gzip-only-text/html * (with browsermatch) for them @@ -715,6 +721,12 @@ return ap_get_brigade(f->next, bb, mode, block, readbytes); } + /* We can't operate on Content-Ranges */ + if (apr_table_get(r->headers_in, "Content-Range") != NULL) { + ap_remove_input_filter(f); + return ap_get_brigade(f->next, bb, mode, block, readbytes); + } + /* Check whether request body is gzipped. * * If it is, we're transforming the contents, invalidating @@ -739,7 +751,6 @@ apr_table_unset(r->headers_in, "Content-Length"); apr_table_unset(r->headers_in, "Content-MD5"); - apr_table_unset(r->headers_in, "Content-Range"); len = 10; rv = apr_brigade_flatten(ctx->bb, deflate_hdr, &len); @@ -968,6 +979,12 @@ return ap_pass_brigade(f->next, bb); } + /* We can't operate on Content-Ranges */ + if (apr_table_get(r->headers_out, "Content-Range") != NULL) { + ap_remove_output_filter(f); + return ap_pass_brigade(f->next, bb); + } + /* * Let's see what our current Content-Encoding is. * Only inflate if gzipped. @@ -986,7 +1003,6 @@ /* these are unlikely to be set anyway, but ... */ apr_table_unset(r->headers_out, "Content-Length"); apr_table_unset(r->headers_out, "Content-MD5"); - apr_table_unset(r->headers_out, "Content-Range"); f->ctx = ctx = apr_pcalloc(f->r->pool, sizeof(*ctx)); ctx->bb = apr_brigade_create(r->pool, f->c->bucket_alloc);