diff options
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/download.hh | 4 | ||||
-rw-r--r-- | src/libstore/http-binary-cache-store.cc | 7 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/libstore/download.hh b/src/libstore/download.hh index 0a278a05e0e1..d9d525d4e65f 100644 --- a/src/libstore/download.hh +++ b/src/libstore/download.hh @@ -21,8 +21,8 @@ struct DownloadRequest std::shared_ptr<std::string> data; std::string mimeType; - DownloadRequest(const std::string & uri, std::shared_ptr<std::string> data = nullptr, std::string mimeType = "") - : uri(uri), parentAct(curActivity), data(std::move(data)), mimeType(std::move(mimeType)) { } + DownloadRequest(const std::string & uri) + : uri(uri), parentAct(curActivity) { } }; struct DownloadResult diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc index 93bd3e5d5982..b9e9cd5daba5 100644 --- a/src/libstore/http-binary-cache-store.cc +++ b/src/libstore/http-binary-cache-store.cc @@ -38,7 +38,7 @@ public: try { BinaryCacheStore::init(); } catch (UploadToHTTP &) { - throw Error(format("'%s' does not appear to be a binary cache") % cacheUri); + throw Error("'%s' does not appear to be a binary cache", cacheUri); } diskCache->createCache(cacheUri, storeDir, wantMassQuery_, priority); } @@ -67,8 +67,9 @@ protected: const std::string & data, const std::string & mimeType) override { - auto data_ = std::make_shared<string>(data); - auto req = DownloadRequest(cacheUri + "/" + path, data_, mimeType); + auto req = DownloadRequest(cacheUri + "/" + path); + req.data = std::make_shared<string>(data); // FIXME: inefficient + req.mimeType = mimeType; try { getDownloader()->download(req); } catch (DownloadError & e) { |