Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:43166 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 82730 invoked from network); 24 Feb 2009 07:37:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Feb 2009 07:37:59 -0000 Authentication-Results: pb1.pair.com header.from=news@ger.gmane.org; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=php-php-dev@m.gmane.org; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain m.gmane.org designates 80.91.229.2 as permitted sender) X-PHP-List-Original-Sender: php-php-dev@m.gmane.org X-Host-Fingerprint: 80.91.229.2 main.gmane.org Linux 2.5 (sometimes 2.4) (4) Received: from [80.91.229.2] ([80.91.229.2:38373] helo=ciao.gmane.org) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/F7-29217-2D3A3A94 for ; Tue, 24 Feb 2009 02:37:57 -0500 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LbrrS-0005KM-7B for internals@lists.php.net; Tue, 24 Feb 2009 07:37:50 +0000 Received: from lily.mit.edu ([18.243.2.157]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Feb 2009 07:37:50 +0000 Received: from edwardzyang by lily.mit.edu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 24 Feb 2009 07:37:50 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: internals@lists.php.net Date: Tue, 24 Feb 2009 02:37:38 -0500 Lines: 24 Message-ID: <49A3A3C2.6090401@thewritingpot.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: rasmus@lerdorf.on.ca, sr@linux.de, zeev@zend.com, nicoletti@nns.ch X-Gmane-NNTP-Posting-Host: lily.mit.edu User-Agent: Thunderbird 2.0.0.19 (X11/20090105) In-Reply-To: Sender: news Subject: Re: [PHP-DEV] Don't compress empty output with zlib From: edwardzyang@thewritingpot.com ("Edward Z. Yang") CC'ed authors of zlib.c Could this patch be applied to PHP_5_2 and further? Index: ext/zlib/zlib.c =================================================================== RCS file: /repository/php-src/ext/zlib/zlib.c,v retrieving revision 1.183.2.6.2.8 diff -u -r1.183.2.6.2.8 zlib.c --- ext/zlib/zlib.c 31 Dec 2008 11:17:47 -0000 1.183.2.6.2.8 +++ ext/zlib/zlib.c 17 Feb 2009 22:13:40 -0000 @@ -979,7 +979,7 @@ { zend_bool do_start, do_end; - if (!ZLIBG(output_compression)) { + if (!ZLIBG(output_compression) || SG(sapi_headers).http_response_code == 304) { *handled_output = NULL; } else { do_start = (mode & PHP_OUTPUT_HANDLER_START ? 1 : 0); Cheers, Edward