about summary refs log tree commit diff
path: root/src/libstore/download.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstore/download.hh')
-rw-r--r--src/libstore/download.hh17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/libstore/download.hh b/src/libstore/download.hh
index efddc55281fe..011b85f4721b 100644
--- a/src/libstore/download.hh
+++ b/src/libstore/download.hh
@@ -9,16 +9,19 @@ namespace nix {
 
 struct DownloadOptions
 {
-    string expectedETag;
-    bool verifyTLS{true};
-    enum { yes, no, automatic } showProgress{yes};
-    bool head{false};
+    std::string expectedETag;
+    bool verifyTLS = true;
+    enum { yes, no, automatic } showProgress = yes;
+    bool head = false;
+    size_t tries = 1;
+    unsigned int baseRetryTimeMs = 100;
 };
 
 struct DownloadResult
 {
     bool cached;
     string etag;
+    string effectiveUrl;
     std::shared_ptr<std::string> data;
 };
 
@@ -28,10 +31,10 @@ struct Downloader
 {
     virtual DownloadResult download(string url, const DownloadOptions & options) = 0;
 
-    Path downloadCached(ref<Store> store, const string & url, bool unpack,
-        const Hash & expectedHash = Hash());
+    Path downloadCached(ref<Store> store, const string & url, bool unpack, string name = "",
+        const Hash & expectedHash = Hash(), string * effectiveUrl = nullptr);
 
-    enum Error { NotFound, Forbidden, Misc };
+    enum Error { NotFound, Forbidden, Misc, Transient };
 };
 
 ref<Downloader> makeDownloader();