Skip to content
This repository has been archived by the owner on May 16, 2018. It is now read-only.

Commit

Permalink
Revert setting of CURLOPT_TIMEOUT
Browse files Browse the repository at this point in the history
PR 405 assigned the 'timeout' config setting to CURLOPT_TIMEOUT in
addition to CURLOPT_CONNECTTIMEOUT. This commit changes this so that a
new config setting of 'request_timeout' is used to setting
CURLOPT_TIMEOUT.

Closes #582
  • Loading branch information
akrabat authored and weierophinney committed Aug 10, 2015
1 parent c25909f commit 7260781
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions library/Zend/Http/Client/Adapter/Curl.php
Expand Up @@ -228,10 +228,12 @@ public function connect($host, $port = 80, $secure = false)
curl_setopt($this->_curl, CURLOPT_CONNECTTIMEOUT, $this->_config['timeout']);
}

if (defined('CURLOPT_TIMEOUT_MS')) {
curl_setopt($this->_curl, CURLOPT_TIMEOUT_MS, $this->_config['timeout'] * 1000);
} else {
curl_setopt($this->_curl, CURLOPT_TIMEOUT, $this->_config['timeout']);
if (array_key_exists('request_timeout', $this->_config)) {
if (defined('CURLOPT_TIMEOUT_MS')) {
curl_setopt($this->_curl, CURLOPT_TIMEOUT_MS, $this->_config['request_timeout'] * 1000);
} else {
curl_setopt($this->_curl, CURLOPT_TIMEOUT, $this->_config['request_timeout']);
}
}

// Set Max redirects
Expand Down

0 comments on commit 7260781

Please sign in to comment.