X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhttp%2FCurlHttpRequest.php;h=8ef9cc226be2d009a38a29361de1d66949ed754f;hb=08f90e9bfe91b407fae72b7cd7156655dc75e642;hp=f457b2192ce2fb2e7c27697ce42999dfb589fe6a;hpb=7bbcff92f95e5ca21eb2b7a413f249966c507589;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/http/CurlHttpRequest.php b/includes/http/CurlHttpRequest.php index f457b2192c..8ef9cc226b 100644 --- a/includes/http/CurlHttpRequest.php +++ b/includes/http/CurlHttpRequest.php @@ -52,12 +52,7 @@ class CurlHttpRequest extends MWHttpRequest { $this->curlOptions[CURLOPT_PROXY] = $this->proxy; $this->curlOptions[CURLOPT_TIMEOUT] = $this->timeout; - - // Only supported in curl >= 7.16.2 - if ( defined( 'CURLOPT_CONNECTTIMEOUT_MS' ) ) { - $this->curlOptions[CURLOPT_CONNECTTIMEOUT_MS] = $this->connectTimeout * 1000; - } - + $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] = [ $this, "readHeader" ]; @@ -98,6 +93,7 @@ class CurlHttpRequest extends MWHttpRequest { $curlHandle = curl_init( $this->url ); if ( !curl_setopt_array( $curlHandle, $this->curlOptions ) ) { + $this->status->fatal( 'http-internal-error' ); throw new InvalidArgumentException( "Error setting curl options." ); }