mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-15 03:51:43 +01:00
added timeout and vendor parameters to IXR_Client, could be very useful for weblog_pings
git-svn-id: http://svn.automattic.com/wordpress/trunk@1673 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fcb0c54764
commit
e7d60415cf
@ -464,11 +464,13 @@ class IXR_Client {
|
|||||||
var $path;
|
var $path;
|
||||||
var $useragent;
|
var $useragent;
|
||||||
var $response;
|
var $response;
|
||||||
|
var $timeout;
|
||||||
|
var $vendor = '';
|
||||||
var $message = false;
|
var $message = false;
|
||||||
var $debug = false;
|
var $debug = false;
|
||||||
// Storage place for an error message
|
// Storage place for an error message
|
||||||
var $error = false;
|
var $error = false;
|
||||||
function IXR_Client($server, $path = false, $port = 80) {
|
function IXR_Client($server, $path = false, $port = 80, $timeout = 30, $vendor = '') {
|
||||||
if (!$path) {
|
if (!$path) {
|
||||||
// Assume we have been given a URL instead
|
// Assume we have been given a URL instead
|
||||||
$bits = parse_url($server);
|
$bits = parse_url($server);
|
||||||
@ -483,6 +485,7 @@ class IXR_Client {
|
|||||||
$this->server = $server;
|
$this->server = $server;
|
||||||
$this->path = $path;
|
$this->path = $path;
|
||||||
$this->port = $port;
|
$this->port = $port;
|
||||||
|
$this->timeout = $timeout;
|
||||||
}
|
}
|
||||||
$this->useragent = 'The Incutio XML-RPC PHP Library';
|
$this->useragent = 'The Incutio XML-RPC PHP Library';
|
||||||
}
|
}
|
||||||
@ -503,7 +506,7 @@ class IXR_Client {
|
|||||||
if ($this->debug) {
|
if ($this->debug) {
|
||||||
echo '<pre>'.htmlspecialchars($request)."\n</pre>\n\n";
|
echo '<pre>'.htmlspecialchars($request)."\n</pre>\n\n";
|
||||||
}
|
}
|
||||||
$fp = @fsockopen($this->server, $this->port);
|
$fp = @fsockopen($this->server, $this->port, $errno, $errstr, $this->timeout);
|
||||||
if (!$fp) {
|
if (!$fp) {
|
||||||
$this->error = new IXR_Error(-32300, 'transport error - could not open socket');
|
$this->error = new IXR_Error(-32300, 'transport error - could not open socket');
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user