summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/net/http/download.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/xmake/modules/net/http/download.lua b/xmake/modules/net/http/download.lua
index d622e75d9..b2802d219 100644
--- a/xmake/modules/net/http/download.lua
+++ b/xmake/modules/net/http/download.lua
@@ -105,6 +105,14 @@ function _curl_download(tool, url, outputfile, opt)
table.insert(argv, tostring(opt.timeout))
end
+ -- set read timeout
+ if opt.read_timeout then
+ table.insert(argv, "--speed-limit")
+ table.insert(argv, "0")
+ table.insert(argv, "--speed-time")
+ table.insert(argv, tostring(opt.read_timeout))
+ end
+
-- set url
table.insert(argv, url)
@@ -181,6 +189,11 @@ function _wget_download(tool, url, outputfile, opt)
table.insert(argv, "--timeout=" .. tostring(opt.timeout))
end
+ -- set read timeout
+ if opt.read_timeout then
+ table.insert(argv, "--read-timeout=" .. tostring(opt.read_timeout))
+ end
+
-- set outputfile
table.insert(argv, "-O")
table.insert(argv, outputfile)