r41443 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41442‎ | r41443 | r41444 >
Date:19:36, 30 September 2008
Author:brion
Status:old
Tags:
Comment:
override the general curl timeout
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/Subversion.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.php
@@ -78,3 +78,5 @@
7979 // to an offsite proxy running this fun little proxy tool:
8080 // http://svn.wikimedia.org/viewvc/mediawiki/trunk/tools/codereview-proxy/
8181 $wgSubversionProxy = false;
 82+$wgSubversionProxyTimeout = 30; // default 3 secs is too short :)
 83+
Index: trunk/extensions/CodeReview/Subversion.php
@@ -5,9 +5,9 @@
66 protected $mRepo;
77
88 public static function newFromRepo( $repo ) {
9 - global $wgSubversionProxy;
 9+ global $wgSubversionProxy, $wgSubversionProxyTimeout;
1010 if( $wgSubversionProxy ) {
11 - return new SubversionProxy( $repo, $wgSubversionProxy );
 11+ return new SubversionProxy( $repo, $wgSubversionProxy, $wgSubversionProxyTimeout );
1212 } elseif( function_exists( 'svn_log' ) ) {
1313 return new SubversionPecl( $repo );
1414 } else {
@@ -206,9 +206,10 @@
207207 * Using a remote JSON proxy
208208 */
209209 class SubversionProxy extends SubversionAdaptor {
210 - function __construct( $repo, $proxy ) {
 210+ function __construct( $repo, $proxy, $timeout=30 ) {
211211 parent::__construct( $repo );
212212 $this->mProxy = $proxy;
 213+ $this->mTimeout = $timeout;
213214 }
214215
215216 function getFile( $path, $rev=null ) {
@@ -239,7 +240,7 @@
240241 }
241242 }
242243 $target = $this->mProxy . '?' . wfArrayToCgi( $params );
243 - $json = Http::get( $target );
 244+ $json = Http::get( $target, $this->mTimeout );
244245 if( $json === false ) {
245246 throw new MWException( "SVN proxy error" );
246247 }

Status & tagging log