r48540 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r48539‎ | r48540 | r48541 >
Date:21:26, 18 March 2009
Author:brion
Status:ok
Tags:
Comment:
* (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 (modified) (history)
  • /trunk/phase3/includes/AjaxResponse.php (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/StreamFile.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/OutputPage.php
@@ -233,6 +233,7 @@
234234 # Not modified
235235 # Give a 304 response code and disable body output
236236 wfDebug( __METHOD__ . ": NOT MODIFIED, $info\n", false );
 237+ ini_set('zlib.output_compression', 0);
237238 $wgRequest->response()->header( "HTTP/1.1 304 Not Modified" );
238239 $this->sendCacheControl();
239240 $this->disable();
Index: trunk/phase3/includes/StreamFile.php
@@ -48,6 +48,7 @@
4949 $modsince = preg_replace( '/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
5050 $sinceTime = strtotime( $modsince );
5151 if ( $stat['mtime'] <= $sinceTime ) {
 52+ ini_set('zlib.output_compression', 0);
5253 header( "HTTP/1.0 304 Not Modified" );
5354 return;
5455 }
Index: trunk/phase3/includes/AjaxResponse.php
@@ -178,6 +178,7 @@
179179 wfDebug( "$fname: -- client send If-Modified-Since: " . $modsince . "\n", false );
180180 wfDebug( "$fname: -- we might send Last-Modified : $lastmod\n", false );
181181 if( ($ismodsince >= $timestamp ) && $wgUser->validateCache( $ismodsince ) && $ismodsince >= $wgCacheEpoch ) {
 182+ ini_set('zlib.output_compression', 0);
182183 $this->setResponseCode( "304 Not Modified" );
183184 $this->disable();
184185 $this->mLastModified = $lastmod;
Index: trunk/phase3/RELEASE-NOTES
@@ -277,6 +277,7 @@
278278 * (bug 11487) Special:Protectedpages doesn't list protections with pr_expiry
279279 IS NULL
280280 * (bug 18018) Deleting a file redirect leaves behind a malfunctioning redirect
 281+* (bug 17537) Disable bad zlib.output_compression output on HTTP 304 responses
281282
282283 == API changes in 1.15 ==
283284 * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions

Status & tagging log