download: use reasonable timeout and retry parameters
authorAndy Chiang <[email protected]>
Sat, 15 Nov 2025 13:19:02 +0000 (20:19 +0700)
committerHauke Mehrtens <[email protected]>
Sat, 15 Nov 2025 14:47:23 +0000 (15:47 +0100)
Set a timeout of 5 seconds and 3 retries to reduce the time it takes for connection timeout.

Signed-off-by: Andy Chiang <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/19977
Signed-off-by: Hauke Mehrtens <[email protected]>
scripts/download.pl

index 09dc91b04be4a19f2198857023feb3f85dcbdb50..25b52d82ec88413e4d0fc5358227e84de12c7db9 100755 (executable)
@@ -124,12 +124,12 @@ sub download_cmd {
        my $filename = shift;
 
        if ($download_tool eq "curl") {
-               return (qw(curl -f --connect-timeout 20 --retry 5 --location),
+               return (qw(curl -f --connect-timeout 5 --retry 3 --location),
                        $check_certificate ? () : '--insecure',
                        shellwords($ENV{CURL_OPTIONS} || ''),
                        $url);
        } elsif ($download_tool eq "wget") {
-               return (qw(wget --tries=5 --timeout=20 --output-document=-),
+               return (qw(wget --tries=3 --timeout=5 --output-document=-),
                        $check_certificate ? () : '--no-check-certificate',
                        shellwords($ENV{WGET_OPTIONS} || ''),
                        $url);