mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
RequestServer+LibHTTP: Cancel requests on client exit
That usually happens in "exceptional" states when the client exits unexpectedly (crash, force quit mid-load, etc), leading to the job flush timer firing and attempting to write to a nonexistent object (the client). This commit makes RS simply cancel such jobs; cancelled jobs in this state simply go away instead of sending notifications around.
This commit is contained in:
parent
41dc58f702
commit
4211639e45
Notes:
github-actions[bot]
2024-07-28 11:46:35 +00:00
Author: https://github.com/alimpfard
Commit: 4211639e45
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/872
8 changed files with 25 additions and 7 deletions
|
@ -576,6 +576,13 @@ void Job::finish_up()
|
|||
{
|
||||
VERIFY(!m_has_scheduled_finish);
|
||||
m_state = State::Finished;
|
||||
|
||||
if (is_cancelled()) {
|
||||
stop_timer();
|
||||
m_has_scheduled_finish = true;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_can_stream_response) {
|
||||
auto maybe_flattened_buffer = ByteBuffer::create_uninitialized(m_buffered_size);
|
||||
if (maybe_flattened_buffer.is_error())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue