From 1dbd0e0b321d103351180a8299e5d331aa693b42 Mon Sep 17 00:00:00 2001 From: Alexander Date: Mon, 14 Aug 2023 23:19:07 +0100 Subject: [PATCH] Reduce maximum packet size from 16MB to 32KB --- .../main/java/gjum/minecraft/mapsync/common/net/SyncClient.java | 2 +- server/src/server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mod/common/src/main/java/gjum/minecraft/mapsync/common/net/SyncClient.java b/mod/common/src/main/java/gjum/minecraft/mapsync/common/net/SyncClient.java index 086ddcee..27770da1 100644 --- a/mod/common/src/main/java/gjum/minecraft/mapsync/common/net/SyncClient.java +++ b/mod/common/src/main/java/gjum/minecraft/mapsync/common/net/SyncClient.java @@ -112,7 +112,7 @@ private void connect() { public void initChannel(SocketChannel ch) { ch.pipeline().addLast( new LengthFieldPrepender(4), - new LengthFieldBasedFrameDecoder(1 << 24, 0, 4, 0, 4), + new LengthFieldBasedFrameDecoder(1 << 15, 0, 4, 0, 4), new ServerPacketDecoder(), new ClientPacketEncoder(), new ClientHandler(SyncClient.this)); diff --git a/server/src/server.ts b/server/src/server.ts index ef4cfdf3..2fac980c 100644 --- a/server/src/server.ts +++ b/server/src/server.ts @@ -68,7 +68,7 @@ export class TcpClient { world: string | undefined /** prevent Out of Memory when client sends a large packet */ - maxFrameSize = 2 ** 24 + maxFrameSize = 2 ** 15 /** sent by client during handshake */ private claimedMojangName?: string