diff options
| author | 2026-03-14 07:38:40 +0000 | |
|---|---|---|
| committer | 2026-03-14 07:39:49 +0000 | |
| commit | 13054387b49d90f6f0a8f431a72bb9006bda5813 (patch) | |
| tree | f6dc2e0edfc2aa2fd29a13e910fcdc74df28748e /modules/websocket.cpp | |
| parent | Rewrite portparser and move to stringutils. (diff) | |
Fix a crash caused by weirdly casting a pointer to an I/O handler.
Diffstat (limited to 'modules/websocket.cpp')
| -rw-r--r-- | modules/websocket.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
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<LocalUserIO*>(sock); - lio->user->lastping = 1; + auto* luser = sock->GetData<LocalUserIO>()->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<LocalUserIO*>(sock); - luser = lio ? lio->user : nullptr; - } + luser = sock->GetData<LocalUserIO>()->user; bool allowedorigin = false; HTTPHeaderFinder originheader; |
