Websocket: Close onloop during Terminate()

Terminate() is called when Zeek shuts down. If WebSocket client threads
were blocked in QueueForProcessing() due to reaching queue limits, these
previously would not exit QueueForProcessing() and instead block
indefinitely, resulting in the ixwebsocket library blocking and its
garbage collection thread running at 100%. Not great.

Closing the onloop instance will unblock the WebSocket client threads
for a timely shutdown.

Closes #4420
This commit is contained in:
Arne Welzel 2025-05-06 11:53:15 +02:00
parent 6ebec6dde7
commit bb06af601f
6 changed files with 115 additions and 0 deletions

View file

@ -247,6 +247,8 @@ void WebSocketEventDispatcher::Terminate() {
}
clients.clear();
onloop->Close();
}
void WebSocketEventDispatcher::QueueForProcessing(WebSocketEvent&& event) {