mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-22 22:16:16 +02:00
Merge pull request #7793 from layus/interrupt_downloads
Check interrupts even when download stalled
This commit is contained in:
commit
a4a5d828e2
1 changed files with 3 additions and 1 deletions
|
@ -829,7 +829,7 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink)
|
||||||
{
|
{
|
||||||
auto state(_state->lock());
|
auto state(_state->lock());
|
||||||
|
|
||||||
while (state->data.empty()) {
|
if (state->data.empty()) {
|
||||||
|
|
||||||
if (state->quit) {
|
if (state->quit) {
|
||||||
if (state->exc) std::rethrow_exception(state->exc);
|
if (state->exc) std::rethrow_exception(state->exc);
|
||||||
|
@ -837,6 +837,8 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink)
|
||||||
}
|
}
|
||||||
|
|
||||||
state.wait(state->avail);
|
state.wait(state->avail);
|
||||||
|
|
||||||
|
if (state->data.empty()) continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
chunk = std::move(state->data);
|
chunk = std::move(state->data);
|
||||||
|
|
Loading…
Reference in a new issue