From 8b1b5f9a12d4b5196be791118c58ae253ba02d96 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 21 Feb 2017 16:04:47 +0100 Subject: [PATCH] Handle CURLE_RECV_ERROR as a transient error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes unable to download ‘https://cache.nixos.org/nar/077h8ji74y9b0qx7rjk71xd80vjqp6q5gy137r553jlvdlxdcdlk.nar.xz’: HTTP error 200 (curl error: Failure when receiving data from the peer) --- src/libstore/download.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/download.cc b/src/libstore/download.cc index 0ca41b15b..25ccd7d0b 100644 --- a/src/libstore/download.cc +++ b/src/libstore/download.cc @@ -273,7 +273,7 @@ struct CurlDownloader : public Downloader httpStatus == 403 ? Forbidden : (httpStatus == 408 || httpStatus == 500 || httpStatus == 503 || httpStatus == 504 || httpStatus == 522 || httpStatus == 524 - || code == CURLE_COULDNT_RESOLVE_HOST) ? Transient : + || code == CURLE_COULDNT_RESOLVE_HOST || code == CURLE_RECV_ERROR) ? Transient : Misc; attempt++;