aboutsummaryrefslogtreecommitdiff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-11-07 11:44:02 +0100
committerEelco Dolstra <edolstra@gmail.com>2019-11-07 11:44:02 +0100
commitf730841db4db3da4dd33a477fcf016139d699722 (patch)
treec6f942a2e8a05c3dd3cddf600507b1e07815c177 /src/libstore
parent850f73045f7d34c51bfd1cddfd2c4c0c61e15a36 (diff)
parent99af822004418b25b6d04eca67949c62e770c16b (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/build.cc2
-rw-r--r--src/libstore/download.cc4
-rw-r--r--src/libstore/download.hh8
3 files changed, 9 insertions, 5 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index fe861e629..bf259e0b6 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -24,8 +24,8 @@
#include <chrono>
#include <regex>
#include <queue>
+#include <climits>
-#include <limits.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sys/types.h>
diff --git a/src/libstore/download.cc b/src/libstore/download.cc
index a5165773a..d49d63912 100644
--- a/src/libstore/download.cc
+++ b/src/libstore/download.cc
@@ -34,6 +34,10 @@ DownloadSettings downloadSettings;
static GlobalConfig::Register r1(&downloadSettings);
+CachedDownloadRequest::CachedDownloadRequest(const std::string & uri)
+ : uri(uri), ttl(settings.tarballTtl)
+{ }
+
std::string resolveUri(const std::string & uri)
{
if (uri.compare(0, 8, "channel:") == 0)
diff --git a/src/libstore/download.hh b/src/libstore/download.hh
index c5dd893b5..487036833 100644
--- a/src/libstore/download.hh
+++ b/src/libstore/download.hh
@@ -2,7 +2,7 @@
#include "types.hh"
#include "hash.hh"
-#include "globals.hh"
+#include "config.hh"
#include <string>
#include <future>
@@ -71,12 +71,12 @@ struct CachedDownloadRequest
bool unpack = false;
std::string name;
Hash expectedHash;
- unsigned int ttl = settings.tarballTtl;
+ unsigned int ttl;
bool gcRoot = false;
bool getLastModified = false;
- CachedDownloadRequest(const std::string & uri)
- : uri(uri) { }
+ CachedDownloadRequest(const std::string & uri);
+ CachedDownloadRequest() = delete;
};
struct CachedDownloadResult