Retry errors which indicate the connection closed prematurely.

See discussion in #442
This commit is contained in:
Nick Craig-Wood 2016-04-29 16:42:08 +01:00
parent 5c2d8ffe33
commit 1752ee3c8b
4 changed files with 64 additions and 4 deletions

View file

@ -142,9 +142,6 @@ var retryErrorCodes = []int{
// shouldRetry returns a boolean as to whether this resp and err
// deserve to be retried. It returns the err as a convenience
func shouldRetry(resp *http.Response, err error) (bool, error) {
if err == io.EOF {
return true, err
}
return fs.ShouldRetry(err) || fs.ShouldRetryHTTP(resp, retryErrorCodes), err
}