Use ByteBuf#clear() instead of skipping readable bytes
This commit is contained in:
@@ -23,7 +23,7 @@ public class LegacyPingDecoder extends ByteToMessageDecoder {
|
||||
}
|
||||
|
||||
if (!ctx.channel().isActive()) {
|
||||
in.skipBytes(in.readableBytes());
|
||||
in.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@@ -18,7 +18,7 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
||||
@Override
|
||||
protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) {
|
||||
if (!ctx.channel().isActive()) {
|
||||
in.skipBytes(in.readableBytes());
|
||||
in.clear();
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user