diff mbox

Allow '-1' to be specified as CONNECTION_TIMEOUT to disable the use of the connection timeout for wget

Message ID cb33f8c2cbaf802d4f04.1399687632@localhost
State Accepted
Commit d7eaba5831d5
Headers show

Commit Message

Cody P Schafer May 10, 2014, 2:07 a.m. UTC
# HG changeset patch
# User Cody Schafer <dev@codyps.com>
# Date 1399687622 25200
#      Fri May 09 19:07:02 2014 -0700
# Node ID cb33f8c2cbaf802d4f04b602b1969bd30adeaae0
# Parent  d13ded5cee5d4ce1dd18092606d96dc37aa32707
Allow '-1' to be specified as CONNECTION_TIMEOUT to disable the use of the connection timeout for wget

Signed-off-by: Cody P Schafer <dev@codyps.com>



--
For unsubscribe information see http://sourceware.org/lists.html#faq

Comments

Yann E. MORIN May 10, 2014, 10:56 a.m. UTC | #1
Cody, All,

Your patch:
    scripts: add possibility to not override default connection timeout

has been applied as: #d7eaba5831d5
    http://crosstool-ng.org/hg/crosstool-ng/rev/d7eaba5831d5

Thank you!

Regards,
Yann E. MORIN.



--
For unsubscribe information see http://sourceware.org/lists.html#faq
diff mbox

Patch

diff --git a/config/global/download.in b/config/global/download.in
--- a/config/global/download.in
+++ b/config/global/download.in
@@ -47,6 +47,8 @@ 
       
       Note that this value applies equally to wget if you have that installed.
 
+      If '-1' is specified, no timeout reconfiguration options are passed to wget/curl.
+
 config ONLY_DOWNLOAD
     bool
     prompt "Stop after downloading tarballs"
diff --git a/scripts/functions b/scripts/functions
--- a/scripts/functions
+++ b/scripts/functions
@@ -572,9 +572,14 @@ 
     # not easy to detect them, so force a global ${CT_CONNECT_TIMEOUT}-second
     # timeout.
     # For curl, no good progress indicator is available. So, be silent.
+    if [ ${CT_CONNECT_TIMEOUT} = -1 ]; then
+        T=
+    else
+        T="-T ${CT_CONNECT_TIMEOUT}"
+    fi
     if CT_DoExecLog ALL wget --passive-ftp --tries=3 -nc    \
                              --progress=dot:binary          \
-                             -T ${CT_CONNECT_TIMEOUT}       \
+                             ${T}                           \
                              -O "${tmp}"                    \
                              "${url}"
     then