Retry download if curl error 55 is encountered (#11543)
parent
3e9c148b63
commit
a6c7b0b327
|
@ -357,6 +357,13 @@ class CurlDownloader
|
||||||
continue;
|
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) {
|
if ($errno === 28 /* CURLE_OPERATION_TIMEDOUT */ && PHP_VERSION_ID >= 70300 && $progress['namelookup_time'] === 0.0 && !$timeoutWarning) {
|
||||||
$timeoutWarning = true;
|
$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>');
|
$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>');
|
||||||
|
|
Loading…
Reference in New Issue