From 7f74513b4e5b632b4099702cf4fe2800de7b67f9 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 26 Feb 2014 16:07:43 +0100 Subject: [PATCH] Also provide an option for setting the curl connection timeout --- doc/manual/conf-file.xml | 14 ++++++++++++++ scripts/download-from-binary-cache.pl.in | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/doc/manual/conf-file.xml b/doc/manual/conf-file.xml index c832108fe..327d22c4a 100644 --- a/doc/manual/conf-file.xml +++ b/doc/manual/conf-file.xml @@ -451,6 +451,20 @@ flag, e.g. --option gc-keep-outputs false. + connect-timeout + + + + The timeout (in seconds) for establishing connections in + the binary cache substituter. It corresponds to + curl’s + option. + + + + + + diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in index 4f7ff12e8..8b49a2517 100644 --- a/scripts/download-from-binary-cache.pl.in +++ b/scripts/download-from-binary-cache.pl.in @@ -44,7 +44,10 @@ my $userName = getpwuid($<) || $ENV{"USER"} or die "cannot figure out user name" my $requireSignedBinaryCaches = ($Nix::Config::config{"signed-binary-caches"} // "0") ne "0"; -my $curlConnectTimeout = int($ENV{"NIX_CONNECT_TIMEOUT"} // 0); +my $curlConnectTimeout = int( + $Nix::Config::config{"untrusted-connect-timeout"} // + $Nix::Config::config{"connect-timeout"} // + $ENV{"NIX_CONNECT_TIMEOUT"} // 0); sub addRequest {