Skip to content

Commit

Permalink
fix for possibly out of order websocket messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rawhat committed Apr 13, 2024
1 parent cb3e8e4 commit 4bf2f78
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mist/internal/websocket.gleam
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,8 @@ fn get_messages(
case frame_from_message(data, context) {
Ok(#(frame, <<>>)) -> #(list.reverse([frame, ..frames]), <<>>)
Ok(#(frame, rest)) -> get_messages(rest, [frame, ..frames], context)
Error(NeedMoreData(rest)) -> #(frames, rest)
Error(InvalidFrame) -> #(frames, data)
Error(NeedMoreData(rest)) -> #(list.reverse(frames), rest)
Error(InvalidFrame) -> #(list.reverse(frames), data)
}
}

Expand Down

0 comments on commit 4bf2f78

Please sign in to comment.