Skip to content

Commit

Permalink
Update unmatched_pings Reset
Browse files Browse the repository at this point in the history
  • Loading branch information
0xIchigo committed Nov 28, 2024
1 parent d358d16 commit afe0787
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/websocket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -278,7 +281,6 @@ impl EnhancedWebsocket {
continue
},
Message::Pong(_data) => {
unmatched_pings = 0;
continue;
},
Message::Close(_frame) => break,
Expand Down

0 comments on commit afe0787

Please sign in to comment.