diff --git a/src/conn.rs b/src/conn.rs index e921353..1c33dc1 100644 --- a/src/conn.rs +++ b/src/conn.rs @@ -170,9 +170,13 @@ struct State { packet_tx: mpsc::UnboundedSender, - // TODO An arbitrary pong frame may be sent unsolicited - last_ws_ping: Option, - last_ws_pong: Option>, + // The server may send a pong frame with arbitrary payload unprompted at any + // time (see RFC 6455 5.5.3). Because of this, we can't just remember the + // last pong payload. + ws_ping_counter: u64, + last_ws_ping: Option>, + last_ws_ping_replied_to: bool, + last_euph_ping: Option