diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-02-28 13:29:29 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-28 13:29:29 +0100 |
commit | a4a5d828e286faaf49f8bc5946b268cecc8a2e7b (patch) | |
tree | 0edf546cfca5976d53cb53515798e76885919169 /src/libstore/filetransfer.cc | |
parent | da1f49c4e39c9f52e085057127bd64adc7d929bf (diff) | |
parent | e6ad8e844029ac340dc3f2a4693c3f4a1d645226 (diff) |
Merge pull request #7793 from layus/interrupt_downloads
Check interrupts even when download stalled
Diffstat (limited to 'src/libstore/filetransfer.cc')
-rw-r--r-- | src/libstore/filetransfer.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index b25089ec3..1c8676a59 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -829,7 +829,7 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink) { auto state(_state->lock()); - while (state->data.empty()) { + if (state->data.empty()) { if (state->quit) { if (state->exc) std::rethrow_exception(state->exc); @@ -837,6 +837,8 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink) } state.wait(state->avail); + + if (state->data.empty()) continue; } chunk = std::move(state->data); |