mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:58:11 +00:00
ProtocolServer: Avoid blocking all downloads when client stops reading
Fixes #4668.
This commit is contained in:
parent
83fed3fd5d
commit
2568a93b5d
7 changed files with 45 additions and 28 deletions
|
@ -376,10 +376,12 @@ void Job::finish_up()
|
|||
|
||||
flush_received_buffers();
|
||||
if (m_buffered_size != 0) {
|
||||
// FIXME: What do we do? ignore it?
|
||||
// "Transmission failed" is not strictly correct, but let's roll with it for now.
|
||||
// We have to wait for the client to consume all the downloaded data
|
||||
// before we can actually call `did_finish`. in a normal flow, this should
|
||||
// never be hit since the client is reading as we are writing, unless there
|
||||
// are too many concurrent downloads going on.
|
||||
deferred_invoke([this](auto&) {
|
||||
did_fail(Error::TransmissionFailed);
|
||||
finish_up();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue