r112663 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r112662‎ | r112663 | r112664 >
Date:00:36, 29 February 2012
Author:aaron
Status:ok
Tags:
Comment:
r111588: refactored proxy/noProxy code slightly for simplicity
Modified paths:
  • /trunk/phase3/includes/HttpFunctions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/HttpFunctions.php
@@ -219,6 +219,10 @@
220220 $this->$o = $options[$o];
221221 }
222222 }
 223+
 224+ if ( $this->noProxy ) {
 225+ $this->proxy = ''; // noProxy takes precedence
 226+ }
223227 }
224228
225229 /**
@@ -279,15 +283,14 @@
280284 }
281285
282286 /**
283 - * Take care of setting up the proxy
284 - * (override in subclass)
 287+ * Take care of setting up the proxy (do nothing if "noProxy" is set)
285288 *
286 - * @return String
 289+ * @return void
287290 */
288291 public function proxySetup() {
289292 global $wgHTTPProxy;
290293
291 - if ( $this->proxy && !$this->noProxy ) {
 294+ if ( $this->proxy || !$this->noProxy ) {
292295 return;
293296 }
294297
@@ -402,11 +405,7 @@
403406 $this->setReferer( wfExpandUrl( $wgTitle->getFullURL(), PROTO_CURRENT ) );
404407 }
405408
406 - /**
407 - * Set up the proxy, but
408 - * clear the proxy when $noProxy is set (takes precedence)
409 - */
410 - $this->proxySetup();
 409+ $this->proxySetup(); // set up any proxy as needed
411410
412411 if ( !$this->callback ) {
413412 $this->setCallback( array( $this, 'read' ) );
@@ -805,7 +804,7 @@
806805 }
807806
808807 $options = array();
809 - if ( $this->proxy && !$this->noProxy ) {
 808+ if ( $this->proxy ) {
810809 $options['proxy'] = $this->urlToTCP( $this->proxy );
811810 $options['request_fulluri'] = true;
812811 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111588important fix inside HttpFunctions.php. I noticed that when you call HttpRequ...wikinaut22:40, 15 February 2012

Status & tagging log