From de941e0c52b66e9e3c408d355bcbce5a5572a9dc Mon Sep 17 00:00:00 2001 From: Erik Corry Date: Mon, 24 Jul 2023 15:11:49 +0200 Subject: [PATCH 1/2] Fix bug in WebSocket masking --- src/web_socket.toit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web_socket.toit b/src/web_socket.toit index 3abf8fc..008cebf 100644 --- a/src/web_socket.toit +++ b/src/web_socket.toit @@ -430,7 +430,7 @@ class FragmentReader_: received_ := 0 masking_bytes /ByteArray? := null - constructor .owner_ .size_ .control_bits_ --masking_bytes/ByteArray?=null: + constructor .owner_ .size_ .control_bits_ --.masking_bytes/ByteArray?=null: is_continuation -> bool: return control_bits_ & 0x0f == OPCODE_CONTINUATION_ is_text -> bool: return control_bits_ & 0x0f == OPCODE_TEXT_ From 8ca754bfecec22143dea31811ef792df3e5320a5 Mon Sep 17 00:00:00 2001 From: Erik Corry Date: Mon, 24 Jul 2023 15:15:22 +0200 Subject: [PATCH 2/2] change field --- src/web_socket.toit | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/web_socket.toit b/src/web_socket.toit index 008cebf..25d81e1 100644 --- a/src/web_socket.toit +++ b/src/web_socket.toit @@ -426,9 +426,9 @@ class WebSocketReader implements reader.Reader: class FragmentReader_: owner_ /WebSocket control_bits_ /int - size_ /int ::= ? + size_ /int received_ := 0 - masking_bytes /ByteArray? := null + masking_bytes /ByteArray? constructor .owner_ .size_ .control_bits_ --.masking_bytes/ByteArray?=null: