1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-14 03:14:59 +00:00

LibHTTP: Disable finish repeat timer before deferring job completion

It was possible to reach this via the timer itself (when the client is
only slightly busy), and then to have the timer fire before the deferred
invocation fires.
This commit removes the race by disabling the timer when the final
deferred-accept state is reached.
This commit is contained in:
Ali Mohammad Pur 2024-03-02 17:43:04 +01:00 committed by Ali Mohammad Pur
parent ec766e8669
commit b9d2d1b478

View file

@ -621,6 +621,7 @@ void Job::finish_up()
return;
}
stop_timer();
m_has_scheduled_finish = true;
auto response = HttpResponse::create(m_code, move(m_headers), m_received_size);
deferred_invoke([this, response = move(response)] {