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.hh14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libstore/download.hh b/src/libstore/download.hh
index d17e14400f1a..cb7de6ef1d99 100644
--- a/src/libstore/download.hh
+++ b/src/libstore/download.hh
@@ -9,10 +9,12 @@ 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
@@ -29,7 +31,7 @@ struct Downloader
 {
     virtual DownloadResult download(string url, const DownloadOptions & options) = 0;
 
-    Path downloadCached(ref<Store> store, const string & url, bool unpack,
+    Path downloadCached(ref<Store> store, const string & url, bool unpack, string name = "",
         const Hash & expectedHash = Hash());
 
     /* Need to overload because can't have an rvalue default value for non-const reference */
@@ -37,7 +39,7 @@ struct Downloader
     Path downloadCached(ref<Store> store, const string & url, bool unpack,
         string & effectiveUrl, const Hash & expectedHash = Hash());
 
-    enum Error { NotFound, Forbidden, Misc };
+    enum Error { NotFound, Forbidden, Misc, Transient };
 };
 
 ref<Downloader> makeDownloader();