From 4bce3270d68074d397b1ac9726f5c970eb517fcb Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN" Date: Mon, 3 Feb 2025 10:34:06 +0100 Subject: [PATCH] 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 Signed-off-by: Peter Korsgaard --- Config.in | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Config.in b/Config.in index c0c1a6079d..a543091d4f 100644 --- a/Config.in +++ b/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"