Skip to content
This repository has been archived by the owner on Dec 20, 2024. It is now read-only.

bug fix dfget client timeout set error when fileLength is 0 #1032

Merged
merged 1 commit into from
Oct 28, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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