Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce maximum packet size from 16MB to 32KB #71

Merged
merged 1 commit into from
Aug 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading