1
0
Fork 0

Also retry for SSL connection failures, refs #10124

pull/10289/head
Jordi Boggiano 2021-11-17 11:02:43 +01:00 committed by GitHub
parent f509c41280
commit 7fc9000834
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -351,8 +351,10 @@ class CurlDownloader
if (
(!isset($job['options']['http']['method']) || $job['options']['http']['method'] === 'GET')
&& in_array($errno, array(7 /* CURLE_COULDNT_CONNECT */, 16 /* CURLE_HTTP2 */), true)
&& $job['attributes']['retries'] < $this->maxRetries
&& (
in_array($errno, array(7 /* CURLE_COULDNT_CONNECT */, 16 /* CURLE_HTTP2 */), true)
|| ($errno === 35 /* CURLE_SSL_CONNECT_ERROR */ && false !== strpos($error, 'Connection reset by peer'))
) && $job['attributes']['retries'] < $this->maxRetries
) {
$this->io->writeError('Retrying ('.($job['attributes']['retries'] + 1).') ' . Url::sanitize($job['url']) . ' due to curl error '. $errno, true, IOInterface::DEBUG);
$this->restartJob($job, $job['url'], array('retries' => $job['attributes']['retries'] + 1));