mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Flush data when download ends
This commit is contained in:
parent
78fea899e0
commit
aa18404ecb
1 changed files with 9 additions and 8 deletions
|
@ -828,6 +828,7 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink)
|
|||
{
|
||||
auto state(_state->lock());
|
||||
|
||||
if (state->data.empty()) {
|
||||
if (state->quit) {
|
||||
if (state->exc) std::rethrow_exception(state->exc);
|
||||
return;
|
||||
|
@ -836,9 +837,9 @@ void FileTransfer::download(FileTransferRequest && request, Sink & sink)
|
|||
state.wait(state->avail);
|
||||
|
||||
if (state->data.empty()) continue;
|
||||
}
|
||||
|
||||
chunk = std::move(state->data);
|
||||
|
||||
state->request.notify_one();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue