fix bug
This commit is contained in:
@@ -51,7 +51,10 @@ public class MinecraftVarintFrameDecoder extends ByteToMessageDecoder {
|
|||||||
return;
|
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 readVarint = reader.getReadVarint();
|
||||||
int bytesRead = reader.getBytesRead();
|
int bytesRead = reader.getBytesRead();
|
||||||
if (readVarint < 0) {
|
if (readVarint < 0) {
|
||||||
|
@@ -33,7 +33,6 @@ class VarintByteDecoder implements ByteProcessor {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (result == DecodeResult.RUN_OF_ZEROES) {
|
if (result == DecodeResult.RUN_OF_ZEROES) {
|
||||||
result = DecodeResult.SUCCESS;
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
readVarint |= (k & 0x7F) << bytesRead++ * 7;
|
readVarint |= (k & 0x7F) << bytesRead++ * 7;
|
||||||
|
Reference in New Issue
Block a user