-
Notifications
You must be signed in to change notification settings - Fork 33
Websocket Ping frames discard remaining frames in buffer #87
Copy link
Copy link
Open
Description
mist/src/mist/internal/websocket.gleam
Lines 315 to 329 in fa3831c
| [Control(PingFrame(payload)), ..], Continue(state, _selector) -> { | |
| transport.send( | |
| connection.transport, | |
| connection.socket, | |
| websocket.encode_pong_frame(payload, None), | |
| ) | |
| |> result.map(fn(_nil) { | |
| set_active(connection.transport, connection.socket) | |
| Continue(state, None) | |
| }) | |
| |> result.lazy_unwrap(fn() { | |
| on_close(state) | |
| AbnormalStop("Failed to send pong frame") | |
| }) | |
| } |
If the ping frame arrives in the same TCP buffer as another frame, the entire buffer is parsed into frames, but once the ping is processed, the remaining frames are discarded. Instead of .., it should capture ..rest and recurse to apply the rest.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels