r92173 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r92172‎ | r92173 | r92174 >
Date:17:48, 14 July 2011
Author:demon
Status:ok
Tags:
Comment:
Use the context's response for header() calls in checkMaxLag()
Modified paths:
  • /trunk/phase3/includes/Wiki.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Wiki.php
@@ -551,10 +551,11 @@
552552 list( $host, $lag ) = $lb->getMaxLag();
553553 if ( $lag > $maxLag ) {
554554 if ( $abort ) {
555 - header( 'HTTP/1.1 503 Service Unavailable' );
556 - header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
557 - header( 'X-Database-Lag: ' . intval( $lag ) );
558 - header( 'Content-Type: text/plain' );
 555+ $resp = $this->context->getRequest()->response();
 556+ $resp->header( 'HTTP/1.1 503 Service Unavailable' );
 557+ $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
 558+ $resp->header( 'X-Database-Lag: ' . intval( $lag ) );
 559+ $resp->header( 'Content-Type: text/plain' );
559560 if( $wgShowHostnames ) {
560561 echo "Waiting for $host: $lag seconds lagged\n";
561562 } else {

Status & tagging log