summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmake/modules/net/http/download.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/xmake/modules/net/http/download.lua b/xmake/modules/net/http/download.lua
index 9ef9ec0a0..d622e75d9 100644
--- a/xmake/modules/net/http/download.lua
+++ b/xmake/modules/net/http/download.lua
@@ -99,6 +99,12 @@ function _curl_download(tool, url, outputfile, opt)
table.insert(argv, "-")
end
+ -- set timeout
+ if opt.timeout then
+ table.insert(argv, "--max-time")
+ table.insert(argv, tostring(opt.timeout))
+ end
+
-- set url
table.insert(argv, url)
@@ -170,6 +176,11 @@ function _wget_download(tool, url, outputfile, opt)
table.insert(argv, "-c")
end
+ -- set timeout
+ if opt.timeout then
+ table.insert(argv, "--timeout=" .. tostring(opt.timeout))
+ end
+
-- set outputfile
table.insert(argv, "-O")
table.insert(argv, outputfile)