Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ws/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl Decoder {
protocol::op::CONTINUATION_FRAME => WebsocketFrame::Continuation(self.fin, payload),
protocol::op::PING => WebsocketFrame::Ping(payload),
protocol::op::CONNECTION_CLOSE => WebsocketFrame::Close(payload),
_ => return Err(Error::Protocol("unknown op_code")),
_ => WebsocketFrame::Unknown(self.op_code, payload),
};
self.decode_state = DecodeState::ReadingHeader;
return Ok(Some(frame));
Expand Down
3 changes: 3 additions & 0 deletions src/ws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,9 @@ pub enum WebsocketFrame {
/// Server has sent close frame. The websocket will be closed as a result. This frame is not
/// exposed to the user.
Close(&'static [u8]),
/// Server has sent an opcode that boomnet does not support. It is up to the user to handle the
/// outcome of an Unknown opcode
Unknown(u8, &'static [u8]),
}

/// Websocket client that owns underlying stream.
Expand Down
Loading