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
commit a4a5d828e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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