Skip to content

Websocket documentation error ? #2408

Discussion options

You must be logged in to vote

https://datatracker.ietf.org/doc/html/rfc6455#section-5.2 :

When encoded on the wire, the most significant bit is the leftmost in the ABNF

msg->flags is not the actual byte in the WS frame, but a copy of it. The order of the bytes in the frame is as seen left to right, and the order of the bits is MSb to LSb left to right. The docs explain msg->flags and that is nevertheless coincident with that.

We don't strip anything, you just don't need to use that, because:

msg->flags = buf[0];

uint8_t final = msg.flags & 128, op = msg.flags & 15;

mongoose/src/ws.c

Lines 211 to 230 in c…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@dev31337
Comment options

Answer selected by scaprile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants