Skip to content

Websocket Ping frames discard remaining frames in buffer #87

@jtdowney

Description

@jtdowney

[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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions