From 7eaaf432e43c4bed1bcec7311c6f4d3b7d8fac0c Mon Sep 17 00:00:00 2001 From: Simon Cruanes Date: Mon, 5 Feb 2024 01:10:23 -0500 Subject: [PATCH] compat fix --- src/ws/tiny_httpd_ws.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ws/tiny_httpd_ws.ml b/src/ws/tiny_httpd_ws.ml index 6c198819..fb8e7af6 100644 --- a/src/ws/tiny_httpd_ws.ml +++ b/src/ws/tiny_httpd_ws.ml @@ -349,7 +349,7 @@ module Reader = struct self.state <- Close; let body = read_body_to_string self in if String.length body >= 2 then ( - let errcode = String.get_int16_be body 0 in + let errcode = Bytes.get_int16_be (Bytes.unsafe_of_string body) 0 in Log.info (fun k -> k "client send 'close' with errcode=%d, message=%S" errcode (String.sub body 2 (String.length body - 2)))