Skip to content

Commit

Permalink
Fix curl downloader to retry in case of DNS resolution failure, fixes #…
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldaek committed Apr 7, 2022
1 parent d7f0733 commit 9bfd059
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Composer/Util/Http/CurlDownloader.php
Expand Up @@ -356,7 +356,7 @@ public function tick()
if (
(!isset($job['options']['http']['method']) || $job['options']['http']['method'] === 'GET')
&& (
in_array($errno, array(7 /* CURLE_COULDNT_CONNECT */, 16 /* CURLE_HTTP2 */, 92 /* CURLE_HTTP2_STREAM */), true)
in_array($errno, array(7 /* CURLE_COULDNT_CONNECT */, 16 /* CURLE_HTTP2 */, 92 /* CURLE_HTTP2_STREAM */, 6 /* CURLE_COULDNT_RESOLVE_HOST */), true)
|| ($errno === 35 /* CURLE_SSL_CONNECT_ERROR */ && false !== strpos($error, 'Connection reset by peer'))
) && $job['attributes']['retries'] < $this->maxRetries
) {
Expand Down

0 comments on commit 9bfd059

Please sign in to comment.