From: Pierre Joye Date: Thu, 16 Oct 2003 18:16:38 +0000 (+0000) Subject: - Fix RPC call without proxy (silence warnings¬ices) X-Git-Tag: RELEASE_1_3b3~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=64e499aaefc900b0e32a52bf13307f1d18957f8e;p=php - Fix RPC call without proxy (silence warnings¬ices) nota bene: the proxy codes should be cleaned, one day ;) --- diff --git a/pear/PEAR/Remote.php b/pear/PEAR/Remote.php index eca2c38409..b49b674d2c 100644 --- a/pear/PEAR/Remote.php +++ b/pear/PEAR/Remote.php @@ -209,7 +209,9 @@ class PEAR_Remote extends PEAR $proxy_user = @$proxy['user']; $proxy_pass = @$proxy['pass']; $fp = @fsockopen($proxy_host, $proxy_port); + $use_proxy = true; } else { + $use_proxy = false; $fp = @fsockopen($server_host, $server_port); } if (!$fp && $http_proxy) { @@ -234,7 +236,7 @@ class PEAR_Remote extends PEAR $maxAge = ''; }; - if ($proxy_host != '' && $proxy_user != '') { + if ($use_proxy && $proxy_host != '' && $proxy_user != '') { $req_headers .= 'Proxy-Authorization: Basic ' .base64_encode($proxy_user.':'.$proxy_pass) ."\r\n"; @@ -247,7 +249,7 @@ class PEAR_Remote extends PEAR var_dump($request); } - if ($proxy_host != '') { + if ($use_proxy && $proxy_host != '') { $post_string = "POST http://".$server_host; if ($proxy_port > '') { $post_string .= ':'.$server_port;