From 3ef0fc89b335be608a408894858912d6ccbba016 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 19 Sep 2024 11:22:43 +0200 Subject: [PATCH] RequestServer: Fix assertion on exit when curl had pending timeouts If we already destroyed our timer during destruction, and then curl tries to flush its timeouts when we tear down the multi, we can just ignore the timer callbacks. --- Userland/Services/RequestServer/ConnectionFromClient.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Userland/Services/RequestServer/ConnectionFromClient.cpp b/Userland/Services/RequestServer/ConnectionFromClient.cpp index c86d70b4ac7a..b11557e51f91 100644 --- a/Userland/Services/RequestServer/ConnectionFromClient.cpp +++ b/Userland/Services/RequestServer/ConnectionFromClient.cpp @@ -163,6 +163,8 @@ int ConnectionFromClient::on_socket_callback(CURL*, int sockfd, int what, void* int ConnectionFromClient::on_timeout_callback(void*, long timeout_ms, void* user_data) { auto* client = static_cast(user_data); + if (!client->m_timer) + return 0; if (timeout_ms < 0) { client->m_timer->stop(); } else {