From b17151a50de33b0865976d023d5087b6df009708 Mon Sep 17 00:00:00 2001 From: CypherPotato Date: Mon, 19 Feb 2024 12:01:19 -0300 Subject: [PATCH] fix ws sending chunked packets --- src/Http/Streams/HttpWebSocket.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Http/Streams/HttpWebSocket.cs b/src/Http/Streams/HttpWebSocket.cs index 46b1857..be4af5f 100644 --- a/src/Http/Streams/HttpWebSocket.cs +++ b/src/Http/Streams/HttpWebSocket.cs @@ -351,7 +351,7 @@ private void SendInternal(ReadOnlyMemory buffer, WebSocketMessageType msgT try { int totalLength = buffer.Length; - int chunks = Math.Max(totalLength / bufferLength, 1); + int chunks = (int)(Math.Ceiling((double)totalLength / bufferLength)); for (int i = 0; i < chunks; i++) {