about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-07-30 12:06:22 +0800
committerkennytm <kennytm@gmail.com>2018-07-30 12:06:22 +0800
commit2994b27e4033c2a0b77ab90f5a896ce09a122992 (patch)
tree5555760b9528693fb53dc5e9bbc2ae9a5e02c049 /src/bootstrap
parentb12235db096ab24a31e6e894757abfe8b018d44a (diff)
downloadrust-2994b27e4033c2a0b77ab90f5a896ce09a122992.tar.gz
rust-2994b27e4033c2a0b77ab90f5a896ce09a122992.zip
Add timeout to use of `curl` in bootstrap.py.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/bootstrap.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py
index 71c1c61e3d9..829487163a9 100644
--- a/src/bootstrap/bootstrap.py
+++ b/src/bootstrap/bootstrap.py
@@ -88,7 +88,10 @@ def _download(path, url, probably_big, verbose, exception):
             option = "-#"
         else:
             option = "-s"
-        run(["curl", option, "--retry", "3", "-Sf", "-o", path, url],
+        run(["curl", option,
+             "-y", "30", "-Y", "10",    # timeout if speed is < 10 bytes/sec for > 30 seconds
+             "--connect-timeout", "30", # timeout if cannot connect within 30 seconds
+             "--retry", "3", "-Sf", "-o", path, url],
             verbose=verbose,
             exception=exception)