Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added timed_out for sendPayloadSocket #84

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dima-bzz
Copy link

No description provided.

@gggeek
Copy link
Owner

gggeek commented Apr 27, 2021

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

@dima-bzz
Copy link
Author

dima-bzz commented Apr 27, 2021

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

Signed-off-by: Dmitry Mazurov <dimabzz@gmail.com>
Signed-off-by: Dmitry Mazurov <dimabzz@gmail.com>
@gggeek
Copy link
Owner

gggeek commented May 9, 2021

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

@dima-bzz
Copy link
Author

dima-bzz commented May 9, 2021

Ok

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants