diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-26T15·07+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-02-26T15·07+0100 |
commit | 7f74513b4e5b632b4099702cf4fe2800de7b67f9 (patch) | |
tree | 5bf26df2d1eb0cc10e4249d9db6bedce381d62f8 | |
parent | 00d761016a33ff9aa0ea162402d0d846dd1927cb (diff) |
Also provide an option for setting the curl connection timeout
-rw-r--r-- | doc/manual/conf-file.xml | 14 | ||||
-rw-r--r-- | scripts/download-from-binary-cache.pl.in | 5 |
2 files changed, 18 insertions, 1 deletions
diff --git a/doc/manual/conf-file.xml b/doc/manual/conf-file.xml index c832108fed06..327d22c4a19d 100644 --- a/doc/manual/conf-file.xml +++ b/doc/manual/conf-file.xml @@ -451,6 +451,20 @@ flag, e.g. <literal>--option gc-keep-outputs false</literal>.</para> </varlistentry> + <varlistentry xml:id="conf-connect-timeout"><term><literal>connect-timeout</literal></term> + + <listitem> + + <para>The timeout (in seconds) for establishing connections in + the binary cache substituter. It corresponds to + <command>curl</command>’s <option>--connect-timeout</option> + option.</para> + + </listitem> + + </varlistentry> + + </variablelist> </para> diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in index 4f7ff12e8f17..8b49a251765f 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 { |