about summary refs log tree commit diff
path: root/src/libstore/http-binary-cache-store.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-01-31T14·12+0100
committerEelco Dolstra <edolstra@gmail.com>2018-01-31T14·14+0100
commit30370f168fef6fd1dd2e888a680e3cabbb7215c1 (patch)
treedbf42ee1de3663272265388690f2d9b579610cde /src/libstore/http-binary-cache-store.cc
parent6270b2e50f94e6686581f041d7824c9fb34da3d8 (diff)
Cleanup
Diffstat (limited to 'src/libstore/http-binary-cache-store.cc')
-rw-r--r--src/libstore/http-binary-cache-store.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc
index 93bd3e5d59..b9e9cd5dab 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) {