netbits: read len as a uint16
This commit is contained in:
parent
7b9e374058
commit
ce54c5bc3d
@ -142,7 +142,7 @@ let of_raw buf =
|
|||||||
decode items (offset + 8) stop
|
decode items (offset + 8) stop
|
||||||
| 0x04 ->
|
| 0x04 ->
|
||||||
if_remains offset 2 @@ fun () ->
|
if_remains offset 2 @@ fun () ->
|
||||||
let len = BE.get_int16 buf offset in
|
let len = BE.get_uint16 buf offset in
|
||||||
let offset = offset + 2 in
|
let offset = offset + 2 in
|
||||||
if_remains offset len @@ fun () ->
|
if_remains offset len @@ fun () ->
|
||||||
let items = B (MBytes.sub buf offset len) :: items in
|
let items = B (MBytes.sub buf offset len) :: items in
|
||||||
@ -153,7 +153,7 @@ let of_raw buf =
|
|||||||
decode items (offset + 8) stop
|
decode items (offset + 8) stop
|
||||||
| 0x06 ->
|
| 0x06 ->
|
||||||
if_remains offset 2 @@ fun () ->
|
if_remains offset 2 @@ fun () ->
|
||||||
let len = BE.get_int16 buf offset in
|
let len = BE.get_uint16 buf offset in
|
||||||
let offset = offset + 2 in
|
let offset = offset + 2 in
|
||||||
if_remains offset len @@ fun () ->
|
if_remains offset len @@ fun () ->
|
||||||
begin match decode [] offset (offset + len) with
|
begin match decode [] offset (offset + len) with
|
||||||
@ -162,7 +162,7 @@ let of_raw buf =
|
|||||||
end
|
end
|
||||||
| 0x07 ->
|
| 0x07 ->
|
||||||
if_remains offset 2 @@ fun () ->
|
if_remains offset 2 @@ fun () ->
|
||||||
let len = BE.get_int16 buf offset in
|
let len = BE.get_uint16 buf offset in
|
||||||
let offset = offset + 2 in
|
let offset = offset + 2 in
|
||||||
if_remains offset len @@ fun () ->
|
if_remains offset len @@ fun () ->
|
||||||
let items = C (MBytes.substring buf offset len) :: items in
|
let items = C (MBytes.substring buf offset len) :: items in
|
||||||
|
Loading…
Reference in New Issue
Block a user