Skip to content

Commit

Permalink
Merge pull request dragonflyoss#1032 from ww3122000/master
Browse files Browse the repository at this point in the history
bug fix dfget client timeout set error when fileLength is 0
  • Loading branch information
starnop authored Oct 28, 2019
2 parents 54e4dd2 + a4a33f3 commit 792840a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dfget/core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ func downloadFile(cfg *config.Config, supernodeAPI api.SupernodeAPI,

timeout := netutils.CalculateTimeout(cfg.RV.FileLength, cfg.MinRate, config.DefaultMinRate, 10*time.Second)
if timeout == 0 && cfg.Timeout > 0 {
timeout = time.Duration(cfg.Timeout) * time.Second
timeout = cfg.Timeout
}
success := true
err := downloader.DoDownloadTimeout(getter, timeout)
Expand Down

0 comments on commit 792840a

Please sign in to comment.