PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Web Services » XML_RPC » Bug #1714

PHP warnings on no connection

Details

Submitted2004-06-24 13:11 UTC
Fromcox at idecnet dot com
Assigneddanielc
StatusClosed
PackageXML_RPC
PHP VersionIrrelevant
Roadmaps(Not assigned)

Comments

[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

[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);
}