Skip to content

Commit 0eca37b

Browse files
committed
Debug build
1 parent 2a1c5da commit 0eca37b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

core/files/CurlDownloader.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ public function __construct(IOInterface $io, Config $config, array $options = []
105105
}
106106
}
107107

108-
curl_multi_setopt($mh, CURLMOPT_MAX_HOST_CONNECTIONS, 8);
109-
110108
if (function_exists('curl_share_init')) {
111109
$this->shareHandle = $sh = curl_share_init();
112110
curl_share_setopt($sh, CURLSHOPT_SHARE, CURL_LOCK_DATA_COOKIE);
@@ -147,7 +145,7 @@ private function initDownload(callable $resolve, callable $reject, string $origi
147145
$attributes = array_merge([
148146
'retryAuthFailure' => true,
149147
'redirects' => 0,
150-
'retries' => 3,
148+
'retries' => 0,
151149
'storeAuth' => false,
152150
'ipResolve' => null,
153151
], $attributes);
@@ -196,13 +194,12 @@ private function initDownload(callable $resolve, callable $reject, string $origi
196194
curl_setopt($curlHandle, CURLOPT_STDERR, fopen('php://stdout', 'w'));
197195
curl_setopt($curlHandle, CURLOPT_URL, $url);
198196
curl_setopt($curlHandle, CURLOPT_FOLLOWLOCATION, false);
199-
curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT, 300);
200-
curl_setopt($curlHandle, CURLOPT_TIMEOUT, 300);
197+
curl_setopt($curlHandle, CURLOPT_CONNECTTIMEOUT, 10);
198+
curl_setopt($curlHandle, CURLOPT_TIMEOUT, max((int) ini_get("default_socket_timeout"), 300));
201199
curl_setopt($curlHandle, CURLOPT_WRITEHEADER, $headerHandle);
202200
curl_setopt($curlHandle, CURLOPT_FILE, $bodyHandle);
203201
curl_setopt($curlHandle, CURLOPT_ENCODING, "");
204202
curl_setopt($curlHandle, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS);
205-
curl_setopt($curlHandle, CURLOPT_SSLVERSION, CURL_SSLVERSION_MAX_TLSv1_2);
206203

207204
if ($attributes['ipResolve'] === 4) {
208205
curl_setopt($curlHandle, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4);

0 commit comments

Comments
 (0)