Correctly handle 0-length packet
This commit is contained in:
@@ -24,7 +24,7 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
|||||||
in.readerIndex(lastReaderIndex);
|
in.readerIndex(lastReaderIndex);
|
||||||
int packetLength = ProtocolUtils.readVarInt(in);
|
int packetLength = ProtocolUtils.readVarInt(in);
|
||||||
if (packetLength == 0) {
|
if (packetLength == 0) {
|
||||||
break find_packets;
|
continue find_packets;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in.readableBytes() < packetLength) {
|
if (in.readableBytes() < packetLength) {
|
||||||
|
Reference in New Issue
Block a user