#2594: Add second way of catching exceptions when handling UDP query
This commit is contained in:
parent
96b1fb1f0e
commit
0dd538f9ff
@ -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 )
|
||||||
|
Loading…
Reference in New Issue
Block a user