Merge pull request #679 from lightpanda-io/increase-MAX_MESSAGE_SIZE

Increase MAX_MESSAGE_SIZE
This commit is contained in:
Pierre Tachoire
2025-05-21 18:03:16 +02:00
committed by GitHub

View File

@@ -45,7 +45,7 @@ const MAX_HTTP_REQUEST_SIZE = 2048;
// max message size
// +14 for max websocket payload overhead
// +140 for the max control packet that might be interleaved in a message
const MAX_MESSAGE_SIZE = 256 * 1024 + 14;
const MAX_MESSAGE_SIZE = 512 * 1024 + 14;
const Server = struct {
app: *App,
@@ -1245,11 +1245,8 @@ test "Client: read invalid websocket message" {
);
}
// length of message is 0000 0401, i.e: 1024 * 256 + 1
try assertWebSocketError(
1009,
&.{ 129, 255, 0, 0, 0, 0, 0, 4, 0, 1, 'm', 'a', 's', 'k' },
);
// length of message is 0000 0401, i.e: 1024 * 512 + 1
try assertWebSocketError(1009, &.{ 129, 255, 0, 0, 0, 0, 0, 8, 0, 1, 'm', 'a', 's', 'k' });
// continuation type message must come after a normal message
// even when not a fin frame