Skip to content

Commit

Permalink
Reduce maximum packet size from 16MB to 32KB
Browse files Browse the repository at this point in the history
  • Loading branch information
Protonull authored and Gjum committed Aug 14, 2023
1 parent b1c9033 commit 0328ef3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0328ef3

Please sign in to comment.