Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.9.4
-
Fix Version/s: 1.9.6
-
Component/s: Zend_Http_Client
-
Labels:None
-
Fix Version Priority:Should Have
Description
When the Curl adapter creates the curl handle it translates the Zend_Http_Client timeout setting into CURLOPT_TIMEOUT. This causes problems when using the adapter for file uploads. The Curl adapter should translate the timeout into CURLOPT_CONNECTTIMEOUT as this is the more compatible setting to how the timeout is used in other adapters.
Here is a patch which fixes the issue:
Index: Http/Client/Adapter/Curl.php
===================================================================
--- Http/Client/Adapter/Curl.php (revision 549)
+++ Http/Client/Adapter/Curl.php (working copy)
@@ -78,7 +78,7 @@
CURLOPT_INFILESIZE,
CURLOPT_PORT,
CURLOPT_MAXREDIRS,
- CURLOPT_TIMEOUT,
+ CURLOPT_CONNECTTIMEOUT,
CURL_HTTP_VERSION_1_1,
CURL_HTTP_VERSION_1_0,
);
@@ -196,7 +196,7 @@
}
// Set timeout
- curl_setopt($this->_curl, CURLOPT_TIMEOUT, $this->_config['timeout']);
+ curl_setopt($this->_curl, CURLOPT_CONNECTTIMEOUT, $this->_config['timeout']);
// Set Max redirects
curl_setopt($this->_curl, CURLOPT_MAXREDIRS, $this->_config['maxredirects']);
Issue Links
| This issue is related to: | ||||
| ZF-8353 | Unit tests for Zend_Http_Client appear to hang on Curl tests |
|
|
|
Hi, Lee.
I agree as 2nd change. Because the following method is used in connect() function for setting
connection parameters.
But, It is hard to understand for me to change $_invalidOverwritableCurlOptions definition. Because this array is used in write() function for setting additional curl options in curl execution.
Do you have any idea?