#2594: Add second way of catching exceptions when handling UDP query

This commit is contained in:
md_5 2019-01-30 22:05:59 +11:00
parent 96b1fb1f0e
commit 0dd538f9ff

View File

@ -50,6 +50,17 @@ public class QueryHandler extends SimpleChannelInboundHandler<DatagramPacket>
@Override @Override
protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception protected void channelRead0(ChannelHandlerContext ctx, DatagramPacket msg) throws Exception
{
try
{
handleMessage( ctx, msg );
} catch ( Throwable t )
{
bungee.getLogger().log( Level.WARNING, "Error whilst handling query packet from " + msg.sender(), t );
}
}
private void handleMessage(ChannelHandlerContext ctx, DatagramPacket msg)
{ {
ByteBuf in = msg.content(); ByteBuf in = msg.content();
if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD ) if ( in.readUnsignedByte() != 0xFE || in.readUnsignedByte() != 0xFD )