Added separate exception for packet overflows to limit log output.

Attacking a server with a hacked client causes the log to print a huge amount of stacktraces. This will limit the log output to the error message.
This commit is contained in:
Zartec
2016-04-01 22:33:07 +02:00
committed by md_5
parent 41621193ec
commit d14b96d55e
3 changed files with 33 additions and 5 deletions

View File

@@ -13,6 +13,7 @@ import net.md_5.bungee.connection.CancelSendSignal;
import net.md_5.bungee.connection.InitialHandler;
import net.md_5.bungee.connection.PingHandler;
import net.md_5.bungee.protocol.BadPacketException;
import net.md_5.bungee.protocol.OverflowPacketException;
/**
* This class is a primitive wrapper for {@link PacketHandler} instances tied to
@@ -104,6 +105,12 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
{
handler, cause.getCause().getMessage()
} );
} else if ( cause instanceof DecoderException && cause.getCause() instanceof OverflowPacketException )
{
ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - overflow in packet detected! {1}", new Object[]
{
handler, cause.getCause().getMessage()
} );
} else if ( cause instanceof IOException )
{
ProxyServer.getInstance().getLogger().log( Level.WARNING, "{0} - IOException: {1}", new Object[]