diff options
Diffstat (limited to 'src/libstore')
-rw-r--r-- | src/libstore/filetransfer.cc | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/libstore/filetransfer.cc b/src/libstore/filetransfer.cc index 756bd4423..2818043e8 100644 --- a/src/libstore/filetransfer.cc +++ b/src/libstore/filetransfer.cc @@ -828,15 +828,14 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink) { auto state(_state->lock()); - while (state->data.empty()) { + if (state->quit) { + if (state->exc) std::rethrow_exception(state->exc); + return; + } - if (state->quit) { - if (state->exc) std::rethrow_exception(state->exc); - return; - } + state.wait(state->avail); - state.wait(state->avail); - } + if (state->data.empty()) continue; chunk = std::move(state->data); |