1
0
Fork 0

Retry download if curl error 55 is encountered (#11543)

pull/11517/head^2
Julian Liebig 2023-07-21 14:29:56 +02:00 committed by GitHub
parent 3e9c148b63
commit a6c7b0b327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 0 deletions

View File

@ -357,6 +357,13 @@ class CurlDownloader
continue;
}
// TODO: Remove this as soon as https://github.com/curl/curl/issues/10591 is resolved
if ($errno === 55 /* CURLE_SEND_ERROR */) {
$this->io->writeError('Retrying ('.($job['attributes']['retries'] + 1).') ' . Url::sanitize($job['url']) . ' due to curl error '. $errno, true, IOInterface::DEBUG);
$this->restartJobWithDelay($job, $job['url'], ['retries' => $job['attributes']['retries'] + 1]);
continue;
}
if ($errno === 28 /* CURLE_OPERATION_TIMEDOUT */ && PHP_VERSION_ID >= 70300 && $progress['namelookup_time'] === 0.0 && !$timeoutWarning) {
$timeoutWarning = true;
$this->io->writeError('<warning>A connection timeout was encountered. If you intend to run Composer without connecting to the internet, run the command again prefixed with COMPOSER_DISABLE_NETWORK=1 to make Composer run in offline mode.</warning>');