mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-25 00:54:32 +00:00
ProtocolServer: Avoid blocking all downloads when client stops reading
Fixes #4668.
This commit is contained in:
committed by
Andreas Kling
parent
83fed3fd5d
commit
2568a93b5d
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user