cluster/websocket: Fix null deref at WebSocket server shutdown

WebSocket clients that connected with the wrong URL do not have
a backend attached. If a dispatcher is terminated while these
clients are still connected, a null deref would happen.

This was found while running all cluster/websocket tests in a loop
for a long time, tickling a segfault during the bad-url test.
This commit is contained in:
Arne Welzel 2025-03-14 15:37:22 +01:00
parent 888af244b2
commit 26441e0c24

View file

@ -231,6 +231,8 @@ void WebSocketEventDispatcher::Terminate() {
wsc->getRemotePort());
QueueReply(WebSocketCloseReply{wsc, 1001, "Terminating"});
if ( backend )
backend->Terminate();
}