about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2018-05-09T13·23+0200
committerYorick van Pelt <yorick@yorickvanpelt.nl>2018-05-09T14·18+0200
commitb9289e4855d0221825c6f673d64f69802daa6b42 (patch)
tree6bf4807beac8ec3e350dd3af5877cb6a0991fa1d /src/libstore
parenta1adcdf0878501b512d7ab98d713167f035a330d (diff)
make sure not to use cached channels for nix-channel --update
fixes #1964
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/download.cc3
-rw-r--r--src/libstore/download.hh3
2 files changed, 3 insertions, 3 deletions
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index 18f9094f82e0..54f4dd218007 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -623,7 +623,7 @@ DownloadResult Downloader::download(const DownloadRequest & request)
     return enqueueDownload(request).get();
 }
 
-Path Downloader::downloadCached(ref<Store> store, const string & url_, bool unpack, string name, const Hash & expectedHash, string * effectiveUrl)
+Path Downloader::downloadCached(ref<Store> store, const string & url_, bool unpack, string name, const Hash & expectedHash, string * effectiveUrl, int ttl)
 {
     auto url = resolveUri(url_);
 
@@ -653,7 +653,6 @@ Path Downloader::downloadCached(ref<Store> store, const string & url_, bool unpa
 
     string expectedETag;
 
-    int ttl = settings.tarballTtl;
     bool skip = false;
 
     if (pathExists(fileLink) && pathExists(dataFile)) {
diff --git a/src/libstore/download.hh b/src/libstore/download.hh
index 0b8d29b21dfe..7ade756fc356 100644
--- a/src/libstore/download.hh
+++ b/src/libstore/download.hh
@@ -2,6 +2,7 @@
 
 #include "types.hh"
 #include "hash.hh"
+#include "globals.hh"
 
 #include <string>
 #include <future>
@@ -54,7 +55,7 @@ struct Downloader
        use the recorded ETag to verify if the server has a more
        recent version, and if so, download it to the Nix store. */
     Path downloadCached(ref<Store> store, const string & uri, bool unpack, string name = "",
-        const Hash & expectedHash = Hash(), string * effectiveUri = nullptr);
+        const Hash & expectedHash = Hash(), string * effectiveUri = nullptr, int ttl = settings.tarballTtl);
 
     enum Error { NotFound, Forbidden, Misc, Transient, Interrupted };
 };