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.hh5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstore/download.hh b/src/libstore/download.hh
index 01940f5447fe..f56274b2353c 100644
--- a/src/libstore/download.hh
+++ b/src/libstore/download.hh
@@ -21,6 +21,7 @@ struct DownloadRequest
     bool decompress = true;
     std::shared_ptr<std::string> data;
     std::string mimeType;
+    std::function<void(char *, size_t)> dataCallback;
 
     DownloadRequest(const std::string & uri)
         : uri(uri), parentAct(getCurActivity()) { }
@@ -49,6 +50,10 @@ struct Downloader
     /* Synchronously download a file. */
     DownloadResult download(const DownloadRequest & request);
 
+    /* Download a file, writing its data to a sink. The sink will be
+       invoked on the thread of the caller. */
+    void download(DownloadRequest && request, Sink & sink);
+
     /* Check if the specified file is already in ~/.cache/nix/tarballs
        and is more recent than ‘tarball-ttl’ seconds. Otherwise,
        use the recorded ETag to verify if the server has a more