Skip to content

Commit

Permalink
Allow default_socket_timeout to extend the curl timeout if it is long…
Browse files Browse the repository at this point in the history
…er than 300s, fixes #10018
  • Loading branch information
Seldaek committed Jul 23, 2021
1 parent e07d2a7 commit 1f44010
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/Util/Http/CurlDownloader.php
Expand Up @@ -160,7 +160,7 @@ private function initDownload($resolve, $reject, $origin, $url, $options, $copyT
curl_setopt($curlHandle, CURLOPT_URL, $url);
curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT, 10);
curl_setopt($curlHandle, CURLOPT_TIMEOUT, 300);
curl_setopt($curlHandle, CURLOPT_TIMEOUT, max((int) ini_get("default_socket_timeout"), 300));
curl_setopt($curlHandle, CURLOPT_WRITEHEADER, $headerHandle);
curl_setopt($curlHandle, CURLOPT_FILE, $bodyHandle);
curl_setopt($curlHandle, CURLOPT_ENCODING, "gzip");
Expand Down

0 comments on commit 1f44010

Please sign in to comment.