Skip to content

Commit

Permalink
fix websocket: read 16-bit length as unsigned
Browse files Browse the repository at this point in the history
  • Loading branch information
c-cube committed Apr 5, 2024
1 parent 00b6efd commit 5301ed4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ws/tiny_httpd_ws.ml
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ module Reader = struct
let len = b1 land 0b0111_1111 in
if len = 126 then (
IO.Input.really_input self.ic self.header_buf 0 2;
Bytes.get_int16_be self.header_buf 0
Bytes.get_uint16_be self.header_buf 0
) else if len = 127 then (
IO.Input.really_input self.ic self.header_buf 0 8;
let len64 = Bytes.get_int64_be self.header_buf 0 in
Expand Down

0 comments on commit 5301ed4

Please sign in to comment.