From fc44014790f6bd97a1e8df2c2d82f33c05790e5b Mon Sep 17 00:00:00 2001 From: Teddy Cornaut Date: Thu, 24 Oct 2019 16:34:14 -0400 Subject: [PATCH] =?UTF-8?q?D=C3=A9finition=20timeout=20curl=20a=2010=20sec?= =?UTF-8?q?ondes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BeSimple/SoapClient/Curl.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/BeSimple/SoapClient/Curl.php b/src/BeSimple/SoapClient/Curl.php index 59146c1..4844bbd 100644 --- a/src/BeSimple/SoapClient/Curl.php +++ b/src/BeSimple/SoapClient/Curl.php @@ -77,9 +77,8 @@ class Curl if (isset($options['compression']) && !($options['compression'] & SOAP_COMPRESSION_ACCEPT)) { curl_setopt($this->ch, CURLOPT_ENCODING, 'identity'); } - if (isset($options['connection_timeout'])) { - curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, $options['connection_timeout']); - } + + curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, 10); if (isset($options['proxy_host'])) { if (false !== $options['proxy_host']) { @@ -167,7 +166,6 @@ class Curl private function execManualRedirect($redirects = 0) { if ($redirects > $this->followLocationMaxRedirects) { - // TODO Redirection limit reached, aborting return false; } @@ -193,7 +191,7 @@ class Curl if (!isset($url['path'])) { $url['path'] = $lastUrl['path']; } - $newUrl = $url['scheme'] . '://' . $url['host'] . $url['path'] . ($url['query'] ? '?' . $url['query'] : ''); + $newUrl = $url['scheme'].'://'.$url['host'].$url['path'].($url['query'] ? '?'.$url['query'] : ''); curl_setopt($this->ch, CURLOPT_URL, $newUrl); return $this->execManualRedirect($redirects++); @@ -205,7 +203,7 @@ class Curl /** * Error code mapping from cURL error codes to PHP ext/soap error messages - * (where applicable) + * (where applicable). * * http://curl.haxx.se/libcurl/c/libcurl-errors.html *