Skip to content

Commit

Permalink
websocket_frame_parser: Update comments
Browse files Browse the repository at this point in the history
  • Loading branch information
lhmouse committed Jul 16, 2023
1 parent 9bb380f commit 535bed6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions poseidon/http/websocket_frame_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,10 @@ parse_frame_header_from_stream(linear_buffer& data)
return;

// Parse the first two bytes, which contain information about other fields.
// This has to be done in an awkward way to prevent compilers from doing
// nonsense. Sorry.
int mask_len_rsv_opcode = bptr[0] | bptr[1] << 8;
int mask_len_rsv_opcode = bptr[1] << 8 | bptr[0];

// Unpack fields. This has to be done in an awkward way to prevent compilers
// from doing nonsense. Sorry.
this->m_frm_header.fin = mask_len_rsv_opcode >> 7 & 1;
this->m_frm_header.rsv1 = mask_len_rsv_opcode >> 6 & 1;
this->m_frm_header.rsv2 = mask_len_rsv_opcode >> 5 & 1;
Expand Down

0 comments on commit 535bed6

Please sign in to comment.