phpxmlrpc
phpxmlrpc copied to clipboard
Added timed_out for sendPayloadSocket
Seems good. Did you check if the same error can also be used for the cURL case ?
Didn't check it. cURL has its own error checking mechanism. In cURL, there are no checks at all for errors, it just checks to see if there is a result.
$result = curl_exec($curl);
if ($this->debug > 1) {
$message = "---CURL INFO---\n";
foreach (curl_getinfo($curl) as $name => $val) {
if (is_array($val)) {
$val = implode("\n", $val);
}
$message .= $name . ': ' . $val . "\n";
}
$message .= '---END---';
$this->getLogger()->debugMessage($message);
}
if (!$result) {
/// @todo we should use a better check here - what if we get back '' or '0'?
$this->errstr = 'no response';
$resp = new Response(0, PhpXmlRpc::$xmlrpcerr['curl_fail'], PhpXmlRpc::$xmlrpcstr['curl_fail'] . ': ' . curl_error($curl));
curl_close($curl);
if ($keepAlive) {
$this->xmlrpc_curl_handle = null;
}
} else {
if (!$keepAlive) {
curl_close($curl);
}
$resp = $req->parseResponse($result, true, $this->return_type);
// if we got back a 302, we can not reuse the curl handle for later calls
if ($resp->faultCode() == PhpXmlRpc::$xmlrpcerr['http_error'] && $keepAlive) {
curl_close($curl);
$this->xmlrpc_curl_handle = null;
}
}
Sorry, busy times. It will take a few weeks before I can look at this.
Ok