phpxmlrpc icon indicating copy to clipboard operation
phpxmlrpc copied to clipboard

Added timed_out for sendPayloadSocket

Open dima-bzz opened this issue 3 years ago • 4 comments

dima-bzz avatar Apr 26 '21 14:04 dima-bzz

Seems good. Did you check if the same error can also be used for the cURL case ?

gggeek avatar Apr 27 '21 06:04 gggeek

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;
            }
        }

dima-bzz avatar Apr 27 '21 09:04 dima-bzz

Sorry, busy times. It will take a few weeks before I can look at this.

gggeek avatar May 09 '21 14:05 gggeek

Ok

dima-bzz avatar May 09 '21 15:05 dima-bzz