From 7853237bb339111ed9403a8533f41ec048924060 Mon Sep 17 00:00:00 2001 From: Outfluencer <48880402+Outfluencer@users.noreply.github.com> Date: Sat, 1 Jun 2024 18:59:55 +0200 Subject: [PATCH] Update HandlerBoss.java --- proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java index 6caf30cdca..d82173b1ea 100644 --- a/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java +++ b/proxy/src/main/java/net/md_5/bungee/netty/HandlerBoss.java @@ -30,6 +30,7 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter private ChannelWrapper channel; private PacketHandler handler; + private boolean healthCheck; public void setHandler(PacketHandler handler) { @@ -96,7 +97,7 @@ public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception channel.setRemoteAddress( newAddress ); } else { - channel.close(); + healthCheck = true; } } finally { @@ -146,7 +147,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E { if ( ctx.channel().isActive() ) { - boolean logExceptions = !( handler instanceof PingHandler ); + boolean logExceptions = !( handler instanceof PingHandler ) && !healthCheck; if ( logExceptions ) {