Waterfall/Waterfall-Proxy-Patches/0025-Always-release-packets.patch
2022-02-19 12:21:14 -03:00

47 lines
1.4 KiB
Diff

From 2dfb39a36578b4d970c594a2e47fcac65926c4bc Mon Sep 17 00:00:00 2001
From: linsaftw <25271111+linsaftw@users.noreply.github.com>
Date: Sat, 1 May 2021 23:28:19 -0300
Subject: [PATCH] Always release packets
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 2f281d0c..e5e98197 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
@@ -117,12 +117,14 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
return;
}
- if ( handler != null )
+ PacketWrapper packet = (PacketWrapper) msg;
+
+
+ try
{
- PacketWrapper packet = (PacketWrapper) msg;
- boolean sendPacket = handler.shouldHandle( packet );
- try
+ if ( handler != null )
{
+ boolean sendPacket = handler.shouldHandle( packet );
if ( sendPacket && packet.packet != null )
{
try
@@ -137,10 +139,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
{
handler.handle( packet );
}
- } finally
- {
- packet.trySingleRelease();
}
+ } finally
+ {
+ packet.trySingleRelease();
}
}
--
2.32.0