diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 904100f7d..018337a8f 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -63,7 +63,7 @@ struct curlFileTransfer : public FileTransfer std::packaged_task< std::pair(std::exception_ptr, FileTransferResult)> callback; - std::function dataCallback; + std::function dataCallback; CURL * req; // must never be nullptr std::string statusMsg; @@ -103,7 +103,7 @@ struct curlFileTransfer : public FileTransfer const Headers & headers, ActivityId parentAct, std::invocable auto callback, - std::function dataCallback, + std::function dataCallback, std::optional uploadData, bool noBody ) @@ -196,7 +196,7 @@ struct curlFileTransfer : public FileTransfer if (successfulStatuses.count(getHTTPStatus()) && this->dataCallback) { writtenToSink += realSize; - dataCallback(*this, {static_cast(contents), realSize}); + dataCallback({static_cast(contents), realSize}); } else { this->downloadData.append(static_cast(contents), realSize); } @@ -732,7 +732,7 @@ struct curlFileTransfer : public FileTransfer const std::string & uri, const Headers & headers, std::invocable auto callback, - std::function dataCallback, + std::function dataCallback, std::optional data, bool noBody ) @@ -816,7 +816,7 @@ struct curlFileTransfer : public FileTransfer state->avail.notify_one(); state->request.notify_one(); }, - [_state](TransferItem & transfer, std::string_view data) { + [_state](std::string_view data) { auto state(_state->lock()); if (state->failed) {