Merge pull request #15057 from NixOS/backport-15047-to-2.33-maintenance

[Backport 2.33-maintenance] fix(libstore/filetransfer): restart source before upload retries
This commit is contained in:
internal-nix-ci[bot]
2026-01-22 21:07:05 +00:00
committed by GitHub

View File

@@ -450,6 +450,11 @@ struct curlFileTransfer : public FileTransfer
curl_easy_setopt(req, CURLOPT_CUSTOMREQUEST, "DELETE");
if (request.data) {
// Restart the source to ensure it's at the beginning.
// This is necessary for retries, where the source was
// already consumed by a previous attempt.
request.data->source->restart();
if (request.method == HttpMethod::Post) {
curl_easy_setopt(req, CURLOPT_POST, 1L);
curl_easy_setopt(req, CURLOPT_POSTFIELDSIZE_LARGE, (curl_off_t) request.data->sizeHint);