mirror of
https://github.com/PaperMC/Velocity.git
synced 2024-12-03 06:52:16 +08:00
Use ByteBuf#clear() instead of skipping readable bytes
This commit is contained in:
parent
7944544606
commit
9adba81d23
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user