Handle CURLE_RECV_ERROR as a transient error

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)
This commit is contained in:
Eelco Dolstra 2017-02-21 16:04:47 +01:00
parent 8d7c6644c5
commit 8b1b5f9a12
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -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++;