瀏覽代碼

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.
Andreas Kling 9 月之前
父節點
當前提交
3ef0fc89b3
共有 1 個文件被更改,包括 2 次插入0 次删除
  1. 2 0
      Userland/Services/RequestServer/ConnectionFromClient.cpp

+ 2 - 0
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)
 int ConnectionFromClient::on_timeout_callback(void*, long timeout_ms, void* user_data)
 {
 {
     auto* client = static_cast<ConnectionFromClient*>(user_data);
     auto* client = static_cast<ConnectionFromClient*>(user_data);
+    if (!client->m_timer)
+        return 0;
     if (timeout_ms < 0) {
     if (timeout_ms < 0) {
         client->m_timer->stop();
         client->m_timer->stop();
     } else {
     } else {