summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/net/http.rb5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/net/http.rb b/lib/net/http.rb
index 387df4b8f4..d143f3b30f 100644
--- a/lib/net/http.rb
+++ b/lib/net/http.rb
@@ -2350,7 +2350,10 @@ module Net #:nodoc:
res
}
res.reading_body(@socket, req.response_body_permitted?) {
- yield res if block_given?
+ if block_given?
+ count = max_retries # Don't restart in the middle of a download
+ yield res
+ end
}
rescue Net::OpenTimeout
raise