diff --git a/src/BeSimple/SoapClient/Curl.php b/src/BeSimple/SoapClient/Curl.php index e777fc8f..eb86a365 100644 --- a/src/BeSimple/SoapClient/Curl.php +++ b/src/BeSimple/SoapClient/Curl.php @@ -59,6 +59,9 @@ public function __construct(array $options = array(), $followLocationMaxRedirect if (!isset($options['user_agent'])) { $options['user_agent'] = self::USER_AGENT; } + if (!isset($options['timeout']) { + $options['timeout'] = ini_get('default_socket_timeout'); + } $this->followLocationMaxRedirects = $followLocationMaxRedirects; // make http request @@ -80,6 +83,9 @@ public function __construct(array $options = array(), $followLocationMaxRedirect if (isset($options['connection_timeout'])) { curl_setopt($this->ch, CURLOPT_CONNECTTIMEOUT, $options['connection_timeout']); } + if (!empty($options['timeout'])) { + curl_setopt($this->ch, CURLOPT_TIMEOUT, $options['timeout']); + } if (isset($options['proxy_host'])) { if (false !== $options['proxy_host']) {