diff --git a/src/PhpEws/Ntlm/NtlmSoapClient.php b/src/PhpEws/Ntlm/NtlmSoapClient.php index 6f2adacb3..37ecbcd06 100644 --- a/src/PhpEws/Ntlm/NtlmSoapClient.php +++ b/src/PhpEws/Ntlm/NtlmSoapClient.php @@ -12,6 +12,8 @@ */ class NtlmSoapClient extends \SoapClient { + private static $timeout = 30; + /** * cURL resource used to make the SOAP request * @@ -63,6 +65,7 @@ public function __doRequest($request, $location, $action, $version, $one_way = 0 curl_setopt($this->ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($this->ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC | CURLAUTH_NTLM); curl_setopt($this->ch, CURLOPT_USERPWD, $this->user.':'.$this->password); + curl_setopt($this->ch, CURLOPT_TIMEOUT, self::$timeout); $response = curl_exec($this->ch); @@ -104,4 +107,16 @@ public function validateCertificate($validate = true) return true; } + + /** + * Set the CURL timeout + * + * @param int $timeout + */ + public static function setTimeout($timeout) + { + self::$timeout = $timeout; + } + + }