summaryrefslogtreecommitdiff
path: root/includes/HttpFunctions.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/HttpFunctions.php')
-rw-r--r--includes/HttpFunctions.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/includes/HttpFunctions.php b/includes/HttpFunctions.php
index 78c2ac7a..fa2fc12b 100644
--- a/includes/HttpFunctions.php
+++ b/includes/HttpFunctions.php
@@ -730,7 +730,12 @@ class CurlHttpRequest extends MWHttpRequest {
$this->curlOptions[CURLOPT_PROXY] = $this->proxy;
$this->curlOptions[CURLOPT_TIMEOUT] = $this->timeout;
- $this->curlOptions[CURLOPT_CONNECTTIMEOUT_MS] = $this->connectTimeout * 1000;
+
+ // Only supported in curl >= 7.16.2
+ if ( defined( 'CURLOPT_CONNECTTIMEOUT_MS' ) ) {
+ $this->curlOptions[CURLOPT_CONNECTTIMEOUT_MS] = $this->connectTimeout * 1000;
+ }
+
$this->curlOptions[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0;
$this->curlOptions[CURLOPT_WRITEFUNCTION] = $this->callback;
$this->curlOptions[CURLOPT_HEADERFUNCTION] = array( $this, "readHeader" );