From d1d60768cc00bf6b2d243039dd13c7696ee9193a Mon Sep 17 00:00:00 2001 From: michelvaldrighi Date: Thu, 16 Sep 2004 17:07:59 +0000 Subject: [PATCH] added timeout and vendor parameters to IXR_Client, could be very useful for weblog_pings git-svn-id: https://develop.svn.wordpress.org/trunk@1673 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/class-IXR.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wp-includes/class-IXR.php b/wp-includes/class-IXR.php index f18da1dd08..387a34ec91 100644 --- a/wp-includes/class-IXR.php +++ b/wp-includes/class-IXR.php @@ -464,11 +464,13 @@ class IXR_Client { var $path; var $useragent; var $response; + var $timeout; + var $vendor = ''; var $message = false; var $debug = false; // Storage place for an error message var $error = false; - function IXR_Client($server, $path = false, $port = 80) { + function IXR_Client($server, $path = false, $port = 80, $timeout = 30, $vendor = '') { if (!$path) { // Assume we have been given a URL instead $bits = parse_url($server); @@ -483,6 +485,7 @@ class IXR_Client { $this->server = $server; $this->path = $path; $this->port = $port; + $this->timeout = $timeout; } $this->useragent = 'The Incutio XML-RPC PHP Library'; } @@ -503,7 +506,7 @@ class IXR_Client { if ($this->debug) { echo '
'.htmlspecialchars($request)."\n
\n\n"; } - $fp = @fsockopen($this->server, $this->port); + $fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout); if (!$fp) { $this->error = new IXR_Error(-32300, 'transport error - could not open socket'); return false;