* NNB: you can set it to any non-empty array for HTTP11 and HTTPS, since
* in those cases it will be up to CURL to decide the compression methods
* it supports. You might check for the presence of 'zlib' in the output of
- * curl_version() to determine wheter compression is supported or not
+ * curl_version() to determine whether compression is supported or not
*/
public $accepted_compression = array();
$this->proxy_pass,
$this->proxy_authtype,
$method,
- $this->keepalive,
$this->key,
$this->keypass,
$this->sslversion
$authType = 1, $proxyHost = '', $proxyPort = 0, $proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1,
$method='http')
{
+ //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
return $this->sendPayloadSocket($req, $server, $port, $timeout, $username, $password, $authType, null, null,
- null, null, $proxyHost, $proxyPort, $proxyUsername, $proxyPassword, $proxyAuthType);
+ null, null, $proxyHost, $proxyPort, $proxyUsername, $proxyPassword, $proxyAuthType, $method);
}
/**
$proxyUsername = '', $proxyPassword = '', $proxyAuthType = 1, $keepAlive = false, $key = '', $keyPass = '',
$sslVersion = 0)
{
+ //trigger_error('Method ' . __METHOD__ . ' is deprecated', E_USER_DEPRECATED);
+
return $this->sendPayloadCURL($req, $server, $port, $timeout, $username,
$password, $authType, $cert, $certPass, $caCert, $caCertDir, $proxyHost, $proxyPort,
$proxyUsername, $proxyPassword, $proxyAuthType, 'https', $keepAlive, $key, $keyPass, $sslVersion);
$payload = $req->payload;
// Deflate request body and set appropriate request headers
+ $encodingHdr = '';
if (function_exists('gzdeflate') && ($this->request_compression == 'gzip' || $this->request_compression == 'deflate')) {
if ($this->request_compression == 'gzip') {
$a = @gzencode($payload);
$encodingHdr = "Content-Encoding: deflate\r\n";
}
}
- } else {
- $encodingHdr = '';
}
// thanks to Grant Rauscher <grant7@firstworld.net> for this
$contextOptions['ssl']['local_pk'] = $key;
}
$contextOptions['ssl']['verify_peer'] = $this->verifypeer;
-
+ $contextOptions['ssl']['verify_peer_name'] = $this->verifypeer;
}
$context = stream_context_create($contextOptions);
$this->errno = 0;
$this->errstr = '';
- $fp = stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout,
+ $fp = @stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout,
STREAM_CLIENT_CONNECT, $context);
if ($fp) {
if ($timeout > 0) {
stream_set_timeout($fp, $timeout);
}
} else {
+ if ($this->errstr == '') {
+ $err = error_get_last();
+ $this->errstr = $err['message'];
+ }
$this->errstr = 'Connect error: ' . $this->errstr;
$r = new Response(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr . ' (' . $this->errno . ')');
break;
case 'struct':
$code = $val['faultCode'];
+ /** @var Value $code */
if ($code->kindOf() != 'scalar' || $code->scalartyp() != 'int') {
return false;
}
$str = $val['faultString'];
+ /** @var Value $str */
if ($str->kindOf() != 'scalar' || $str->scalartyp() != 'string') {
return false;
}