Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.5

Bug #1714 PHP warnings on no connection
Submitted: 2004-06-24 13:11 UTC
From: cox at idecnet dot com Assigned: danielc
Status: Closed Package: XML_RPC
PHP Version: Irrelevant OS:
Roadmaps: (Not assigned)    
Subscription  


 [2004-06-24 13:11 UTC] cox at idecnet dot com
Description: ------------ ]$ pear -c include/pear.conf install HTTP_Upload Warning: fsockopen(): php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution in RPC.php on line 464 Warning: fsockopen(): unable to connect to pear.php.net:80 in RPC.php on line 464 xml_rpc_client: Connection to RPC server pear.php.net failed /// The latest well formatted error is enough. Tomas V.V.Cox

Comments

 [2004-10-19 04:29 UTC] cellog
isn't this an XML_RPC bug? RPC.php is not in PEAR
 [2004-11-30 23:37 UTC] techtonik at tut dot by
I had the same issue with Net_Socket where I've already commited that patch. How about to integrate Net_Socket with XML_RPC? --- E:\RPC_olda.php Wed Dec 01 01:05:54 2004 +++ E:\RPC.php Wed Dec 01 01:33:18 2004 @@ -458,18 +458,26 @@ function sendPayloadHTTP10($msg, $server, $port, $timeout=0, $username = "", $password = "") { + if (strspn($server, '.0123456789') == strlen($server)) { + $addr = $server; + } else { + $addr = gethostbyname($server); + if (strcmp($server, $addr) == 0) { + return $this->raiseError("Unable to lookup hostname '$server'"); + } + } // If we're using a proxy open a socket to the proxy server instead to the xml-rpc server if ($this->proxy){ if ($timeout > 0) { - $fp = fsockopen($this->proxy, $this->proxy_port, $this->errno, $this->errstr, $timeout); + $fp = @fsockopen($this->proxy, $this->proxy_port, $this->errno, $this->errstr, $timeout); } else { - $fp = fsockopen($this->proxy, $this->proxy_port, $this->errno, $this->errstr); + $fp = @fsockopen($this->proxy, $this->proxy_port, $this->errno, $this->errstr); } } else { if ($timeout > 0) { - $fp = fsockopen($server, $port, $this->errno, $this->errstr, $timeout); + $fp = @fsockopen($server, $port, $this->errno, $this->errstr, $timeout); } else { - $fp = fsockopen($server, $port, $this->errno, $this->errstr); + $fp = @fsockopen($server, $port, $this->errno, $this->errstr); } } @@ -479,7 +487,7 @@ XML_RPC_ERROR_CONNECTION_FAILED); } elseif (!$fp) { $this->raiseError( - "Connection to RPC server " . $this->server . " failed", + "Connection to RPC server " . $server . " failed", XML_RPC_ERROR_CONNECTION_FAILED); }
 [2004-12-29 17:37 UTC] danielc
Fixed in CVS.