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

Commit a595663

Browse files
author
wangweiweir
committed
bug fix dfget client timeout set error when fileLength is 0
Signed-off-by: wangweiweir <[email protected]>
1 parent 5dd6fbb commit a595663

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

dfget/core/core.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ func downloadFile(cfg *config.Config, supernodeAPI api.SupernodeAPI,
179179

180180
timeout := netutils.CalculateTimeout(cfg.RV.FileLength, cfg.MinRate, config.DefaultMinRate, 10*time.Second)
181181
if timeout == 0 && cfg.Timeout > 0 {
182-
timeout = time.Duration(cfg.Timeout) * time.Second
182+
timeout = cfg.Timeout
183183
}
184184
success := true
185185
err := downloader.DoDownloadTimeout(getter, timeout)

0 commit comments

Comments
 (0)