Merge pull request #7793 from layus/interrupt_downloads

Check interrupts even when download stalled
This commit is contained in:
Eelco Dolstra
2023-02-28 13:29:29 +01:00
committed by GitHub

View File

@@ -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);