From afe0787857ba21c56ac51c99a551fa7ea9b25fce Mon Sep 17 00:00:00 2001 From: Evan <0xIchigo@protonmail.com> Date: Thu, 28 Nov 2024 13:43:52 -0500 Subject: [PATCH] Update unmatched_pings Reset --- src/websocket.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/websocket.rs b/src/websocket.rs index 1327843..fd6b56c 100644 --- a/src/websocket.rs +++ b/src/websocket.rs @@ -269,6 +269,9 @@ impl EnhancedWebsocket { None => break, }; + // Reset unmatched_pings on any received frame + unmatched_pings = 0; + // Get text from the message let text = match msg { Message::Text(text) => text, @@ -278,7 +281,6 @@ impl EnhancedWebsocket { continue }, Message::Pong(_data) => { - unmatched_pings = 0; continue; }, Message::Close(_frame) => break,