File tree 1 file changed +3
-7
lines changed
1 file changed +3
-7
lines changed Original file line number Diff line number Diff line change @@ -308,7 +308,7 @@ struct CurlDownloader : public Downloader
308
308
curl_easy_setopt (req, CURLOPT_NETRC_FILE, settings.netrcFile .get ().c_str ());
309
309
curl_easy_setopt (req, CURLOPT_NETRC, CURL_NETRC_OPTIONAL);
310
310
311
- if (writtenToSink)
311
+ if (writtenToSink && acceptRanges && encoding. empty () )
312
312
curl_easy_setopt (req, CURLOPT_RESUME_FROM_LARGE, writtenToSink);
313
313
314
314
result.data = std::make_shared<std::string>();
@@ -416,14 +416,10 @@ struct CurlDownloader : public Downloader
416
416
download after a while. If we're writing to a
417
417
sink, we can only retry if the server supports
418
418
ranged requests. */
419
- if (err == Transient
420
- && attempt < request.tries
421
- && (!this ->request .dataCallback
422
- || writtenToSink == 0
423
- || (acceptRanges && encoding.empty ())))
419
+ if (err == Transient && attempt < request.tries )
424
420
{
425
421
int ms = request.baseRetryTimeMs * std::pow (2 .0f , attempt - 1 + std::uniform_real_distribution<>(0.0 , 0.5 )(downloader.mt19937 ));
426
- if (writtenToSink)
422
+ if (writtenToSink && acceptRanges && encoding. empty () )
427
423
warn (" %s; retrying from offset %d in %d ms" , exc.what (), writtenToSink, ms);
428
424
else
429
425
warn (" %s; retrying in %d ms" , exc.what (), ms);
You can’t perform that action at this time.
0 commit comments