fix websocket: read 16-bit length as unsigned

This commit is contained in:
Simon Cruanes 2024-04-04 22:11:08 -04:00
parent 00b6efdcd5
commit 5301ed40ea
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -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