Check interupts even when download stalled
This commit is contained in:
parent
e4a2a5c074
commit
78fea899e0
|
@ -828,16 +828,15 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink)
|
||||||
{
|
{
|
||||||
auto state(_state->lock());
|
auto state(_state->lock());
|
||||||
|
|
||||||
while (state->data.empty()) {
|
if (state->quit) {
|
||||||
|
if (state->exc) std::rethrow_exception(state->exc);
|
||||||
if (state->quit) {
|
return;
|
||||||
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);
|
chunk = std::move(state->data);
|
||||||
|
|
||||||
state->request.notify_one();
|
state->request.notify_one();
|
||||||
|
|
Loading…
Reference in a new issue