fix bug
This commit is contained in:
@@ -51,7 +51,10 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
||||
return;
|
||||
}
|
||||
|
||||
if (reader.getResult() == DecodeResult.SUCCESS) {
|
||||
if (reader.getResult() == DecodeResult.RUN_OF_ZEROES) {
|
||||
// this will return to the point where the next varint starts
|
||||
in.readerIndex(varintEnd);
|
||||
} else if (reader.getResult() == DecodeResult.SUCCESS) {
|
||||
int readVarint = reader.getReadVarint();
|
||||
int bytesRead = reader.getBytesRead();
|
||||
if (readVarint < 0) {
|
||||
|
@@ -33,7 +33,6 @@ class VarintByteDecoder implements ByteProcessor {
|
||||
return true;
|
||||
}
|
||||
if (result == DecodeResult.RUN_OF_ZEROES) {
|
||||
result = DecodeResult.SUCCESS;
|
||||
return false;
|
||||
}
|
||||
readVarint |= (k & 0x7F) << bytesRead++ * 7;
|
||||
|
Reference in New Issue
Block a user