From 6c2609c5f9f85f4bd9673a97cf8d58325458f6bc Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 26 Oct 2024 17:39:36 +0200 Subject: [PATCH] libstore: remove FileTransferRequest::tries it's never set, and then only used internally. *once*. Change-Id: I32585b1821e979f3ebb53b794ba0d1f576126b92 --- src/libstore/filetransfer.cc | 3 ++- src/libstore/filetransfer.hh | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index f62b414e3..3a4ff04c3 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -56,6 +56,7 @@ struct curlFileTransfer : public FileTransfer std::string statusMsg; unsigned int attempt = 0; + const size_t tries = fileTransferSettings.tries; /* Don't start this download until the specified time point has been reached. */ @@ -438,7 +439,7 @@ struct curlFileTransfer : public FileTransfer sink, we can only retry if the server supports ranged requests. */ if (err == Transient - && attempt < request.tries + && attempt < tries && (!this->dataCallback || writtenToSink == 0 || (acceptRanges && encoding.empty()))) diff --git a/src/libstore/filetransfer.hh b/src/libstore/filetransfer.hh index a53ef7af9..63e30aa0c 100644 --- a/src/libstore/filetransfer.hh +++ b/src/libstore/filetransfer.hh @@ -59,7 +59,6 @@ struct FileTransferRequest std::string expectedETag; bool verifyTLS = true; bool head = false; - size_t tries = fileTransferSettings.tries; FileTransferRequest(std::string_view uri) : uri(uri) { }