diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 5a606b207..b68c636fa 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -663,10 +663,9 @@ struct curlFileTransfer : public FileTransfer return enqueueFileTransfer(uri, headers, std::nullopt, false); } - std::future - enqueueUpload(const std::string & uri, std::string data, const Headers & headers) override + void upload(const std::string & uri, std::string data, const Headers & headers) override { - return enqueueFileTransfer(uri, headers, std::move(data), false); + enqueueFileTransfer(uri, headers, std::move(data), false).get(); } std::future enqueueFileTransfer( diff --git a/src/libstore/filetransfer.hh b/src/libstore/filetransfer.hh index b885c59d5..2900fdee5 100644 --- a/src/libstore/filetransfer.hh +++ b/src/libstore/filetransfer.hh @@ -80,8 +80,8 @@ struct FileTransfer /** * Upload some data. May throw a FileTransferError exception. */ - virtual std::future - enqueueUpload(const std::string & uri, std::string data, const Headers & headers = {}) = 0; + virtual void + upload(const std::string & uri, std::string data, const Headers & headers = {}) = 0; /** * Checks whether the given URI exists. For historical reasons this function diff --git a/src/libstore/http-binary-cache-store.cc b/src/libstore/http-binary-cache-store.cc index c7bfb8e0c..4afec752f 100644 --- a/src/libstore/http-binary-cache-store.cc +++ b/src/libstore/http-binary-cache-store.cc @@ -127,9 +127,7 @@ protected: { auto data = StreamToSourceAdapter(istream).drain(); try { - getFileTransfer() - ->enqueueUpload(makeURI(path), std::move(data), {{"Content-Type", mimeType}}) - .get(); + getFileTransfer()->upload(makeURI(path), std::move(data), {{"Content-Type", mimeType}}); } catch (FileTransferError & e) { throw UploadToHTTP( "while uploading to HTTP binary cache at '%s': %s", cacheUri, e.msg()