瀏覽代碼

Config.in: timeout earlier when connecting to download servers

Some sites have broken DNS entries where some A or AAAA records point
to a nonexistent machine. This causes a long delay (~135sec here) before
a fallback to another IP is attempted. This is the case for example for
sigrok.org, which IPv6 entry is not reachable (at least from the few
locations I have access to, while other IPv6 servers are reachable).

Add a relatively small timeout on connect for the few download backends
where we can easily drive that setting:

  - for curl and wget, that timeout only applies when establishing the
    TCP connection, i.e. the three-way handshake;
  - for scp and sftp, that timeout also include the ssh handshake;
  - for svn, it is not explicit what the timeout is about, but the
    documentation states "Timeout for HTTP requests in seconds".

In modern times, we expect that we can indeed establish those handshakes
in less than 10s; anything taking longer is in practice an unreachable
site...

For other download mechanism (bzr, cvs, git, hg), as well as
post-processing helpers (cargo, go), it does not seem possible to set
such a timeout.

Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Yann E. MORIN 6 月之前
父節點
當前提交
4bce3270d6
共有 1 個文件被更改,包括 5 次插入5 次删除
  1. 5 5
      Config.in

+ 5 - 5
Config.in

@@ -114,15 +114,15 @@ menu "Commands"
 
 config BR2_CURL
 	string "Curl command"
-	default "curl -q --ftp-pasv --retry 3"
+	default "curl -q --ftp-pasv --retry 3 --connect-timeout 10"
 
 config BR2_WGET
 	string "Wget command"
-	default "wget -nd -t 3"
+	default "wget -nd -t 3 --connect-timeout=10"
 
 config BR2_SVN
 	string "Subversion (svn) command"
-	default "svn --non-interactive"
+	default "svn --non-interactive --config-option servers:global:http-timeout=10"
 
 config BR2_BZR
 	string "Bazaar (bzr) command"
@@ -142,11 +142,11 @@ config BR2_LOCALFILES
 
 config BR2_SCP
 	string "Secure copy (scp) command"
-	default "scp"
+	default "scp -o ConnectTimeout=10"
 
 config BR2_SFTP
 	string "Secure file transfer (sftp) command"
-	default "sftp"
+	default "sftp -o ConnectTimeout=10"
 
 config BR2_HG
 	string "Mercurial (hg) command"