From 5e048905ccb75097dc73d32124ecbaeb9e69da29 Mon Sep 17 00:00:00 2001 From: Gravit Date: Sat, 21 Nov 2020 20:33:10 +0700 Subject: [PATCH] [FEATURE] Netty maxWebSocketRequestBytes --- .../java/pro/gravit/launchserver/config/LaunchServerConfig.java | 1 + .../pro/gravit/launchserver/socket/LauncherNettyServer.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java index 3c242394..8bd46f99 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/config/LaunchServerConfig.java @@ -313,6 +313,7 @@ public static class NettyPerformanceConfig { public int bossThread; public int workerThread; public long sessionLifetimeMs = 24 * 60 * 60 * 1000; + public int maxWebSocketRequestBytes = 1024 * 1024; } public static class NettyBindAddress { diff --git a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java index 668df90d..f6af5b05 100644 --- a/LaunchServer/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java +++ b/LaunchServer/src/main/java/pro/gravit/launchserver/socket/LauncherNettyServer.java @@ -56,7 +56,7 @@ public void initChannel(SocketChannel ch) { NettyConnectContext context = new NettyConnectContext(); //p.addLast(new LoggingHandler(LogLevel.INFO)); pipeline.addLast("http-codec", new HttpServerCodec()); - pipeline.addLast("http-codec-compressor", new HttpObjectAggregator(65536)); + pipeline.addLast("http-codec-compressor", new HttpObjectAggregator(server.config.netty.performance.maxWebSocketRequestBytes)); if (server.config.netty.ipForwarding) pipeline.addLast("forward-http", new NettyIpForwardHandler(context)); pipeline.addLast("websock-comp", new WebSocketServerCompressionHandler());