From 852f128c8214a8be95ea66d8e07be7221ed75da9 Mon Sep 17 00:00:00 2001 From: gggeek Date: Mon, 6 Nov 2017 00:33:04 +0000 Subject: [PATCH] travis test --- NEWS | 3 ++- src/Client.php | 10 ++++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/NEWS b/NEWS index 2d2f6c7..aaec3b5 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -XML-RPC for PHP version 4.3.0 - 2017/11/5 +XML-RPC for PHP version 4.3.0 - 2017/11/5.. * fixed: compatibility with Basic/Digest/NTLM auth when using client in cURL mode (issue #55) @@ -7,6 +7,7 @@ XML-RPC for PHP version 4.3.0 - 2017/11/5 * new: allow to force usage of curl for http &.0 calls, as well as plain socket for https calls, via the method `Client::setUseCurl()` + XML-RPC for PHP version 4.2.2 - 2017/10/15 * fixed: compatibility with Lighttpd target servers when using client in cURL mode and request body size > 1024 bytes (issue #56) diff --git a/src/Client.php b/src/Client.php index 6fc8950..b2f5175 100644 --- a/src/Client.php +++ b/src/Client.php @@ -776,7 +776,10 @@ class Client $connectTimeout = $timeout; } - $fp = @stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout, + $this->errno = 0; + $this->errstr = ''; + + $fp = stream_socket_client("$transport://$connectServer:$connectPort", $this->errno, $this->errstr, $connectTimeout, STREAM_CLIENT_CONNECT, $context); if ($fp) { if ($timeout > 0) { @@ -795,10 +798,8 @@ class Client $r = new Response(0, PhpXmlRpc::$xmlrpcerr['http_error'], $this->errstr); return $r; - } else { - // reset errno and errstr on successful socket connection - $this->errstr = ''; } + // G. Giunta 2005/10/24: close socket before parsing. // should yield slightly better execution times, and make easier recursive calls (e.g. to follow http redirects) $ipd = ''; @@ -808,6 +809,7 @@ class Client $ipd .= fread($fp, 32768); } while (!feof($fp)); fclose($fp); + $r = $req->parseResponse($ipd, false, $this->return_type); return $r; -- 2.43.0