From a4a33f3795a115fa1c7d19ee5f58ea5765b45ccc Mon Sep 17 00:00:00 2001 From: wangweiweir Date: Mon, 28 Oct 2019 10:47:40 +0800 Subject: [PATCH] bug fix dfget client timeout set error when fileLength is 0 Signed-off-by: wangweiweir --- dfget/core/core.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dfget/core/core.go b/dfget/core/core.go index 0c90284db..43d627cb4 100644 --- a/dfget/core/core.go +++ b/dfget/core/core.go @@ -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)