|
[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.
mist/src/mist/internal/websocket.gleam
Lines 315 to 329 in fa3831c
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..restand recurse to apply the rest.