Revision: 48540
Author:   brion
Date:     2009-03-18 21:26:57 +0000 (Wed, 18 Mar 2009)

Log Message:
-----------
* (bug 17537) Disable bad zlib.output_compression output on HTTP 304 responses
Patch by ezyang - http://bug-attachment.wikimedia.org/attachment.cgi?id=5829

Modified Paths:
--------------
    trunk/phase3/RELEASE-NOTES
    trunk/phase3/includes/AjaxResponse.php
    trunk/phase3/includes/OutputPage.php
    trunk/phase3/includes/StreamFile.php

Modified: trunk/phase3/RELEASE-NOTES
===================================================================
--- trunk/phase3/RELEASE-NOTES  2009-03-18 21:22:41 UTC (rev 48539)
+++ trunk/phase3/RELEASE-NOTES  2009-03-18 21:26:57 UTC (rev 48540)
@@ -277,6 +277,7 @@
 * (bug 11487) Special:Protectedpages doesn't list protections with pr_expiry
   IS NULL
 * (bug 18018) Deleting a file redirect leaves behind a malfunctioning redirect
+* (bug 17537) Disable bad zlib.output_compression output on HTTP 304 responses
 
 == API changes in 1.15 ==
 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

Modified: trunk/phase3/includes/AjaxResponse.php
===================================================================
--- trunk/phase3/includes/AjaxResponse.php      2009-03-18 21:22:41 UTC (rev 
48539)
+++ trunk/phase3/includes/AjaxResponse.php      2009-03-18 21:26:57 UTC (rev 
48540)
@@ -178,6 +178,7 @@
                        wfDebug( "$fname: -- client send If-Modified-Since: " . 
$modsince . "\n", false );
                        wfDebug( "$fname: --  we might send Last-Modified : 
$lastmod\n", false );
                        if( ($ismodsince >= $timestamp ) && 
$wgUser->validateCache( $ismodsince ) && $ismodsince >= $wgCacheEpoch ) {
+                               ini_set('zlib.output_compression', 0);
                                $this->setResponseCode( "304 Not Modified" );
                                $this->disable();
                                $this->mLastModified = $lastmod;

Modified: trunk/phase3/includes/OutputPage.php
===================================================================
--- trunk/phase3/includes/OutputPage.php        2009-03-18 21:22:41 UTC (rev 
48539)
+++ trunk/phase3/includes/OutputPage.php        2009-03-18 21:26:57 UTC (rev 
48540)
@@ -233,6 +233,7 @@
                # Not modified
                # Give a 304 response code and disable body output 
                wfDebug( __METHOD__ . ": NOT MODIFIED, $info\n", false );
+               ini_set('zlib.output_compression', 0);
                $wgRequest->response()->header( "HTTP/1.1 304 Not Modified" );
                $this->sendCacheControl();
                $this->disable();

Modified: trunk/phase3/includes/StreamFile.php
===================================================================
--- trunk/phase3/includes/StreamFile.php        2009-03-18 21:22:41 UTC (rev 
48539)
+++ trunk/phase3/includes/StreamFile.php        2009-03-18 21:26:57 UTC (rev 
48540)
@@ -48,6 +48,7 @@
                $modsince = preg_replace( '/;.*$/', '', 
$_SERVER['HTTP_IF_MODIFIED_SINCE'] );
                $sinceTime = strtotime( $modsince );
                if ( $stat['mtime'] <= $sinceTime ) {
+                       ini_set('zlib.output_compression', 0);
                        header( "HTTP/1.0 304 Not Modified" );
                        return;
                }



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to