From 13054387b49d90f6f0a8f431a72bb9006bda5813 Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sat, 14 Mar 2026 07:38:40 +0000 Subject: Fix a crash caused by weirdly casting a pointer to an I/O handler. --- modules/websocket.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'modules/websocket.cpp') diff --git a/modules/websocket.cpp b/modules/websocket.cpp index 2c6b135ac..cde1ad433 100644 --- a/modules/websocket.cpp +++ b/modules/websocket.cpp @@ -333,8 +333,8 @@ class WebSocketHook final else if (sock->type == StreamSocket::SS_USER && config.nativeping) { // Pong reply on user socket; reset their idle time. - auto* lio = reinterpret_cast(sock); - lio->user->lastping = 1; + auto* luser = sock->GetData()->user; + luser->lastping = 1; } return 1; } @@ -427,10 +427,7 @@ class WebSocketHook final LocalUser* luser = nullptr; if (sock->type == StreamSocket::SS_USER) - { - auto* lio = reinterpret_cast(sock); - luser = lio ? lio->user : nullptr; - } + luser = sock->GetData()->user; bool allowedorigin = false; HTTPHeaderFinder originheader; -- cgit v1.3.1-10-gc9f91