fix message decoding issue for null string
@@ -431,6 +431,15 @@ public class NativeMessageCodec implements MessageCodec {
}
public String readString(ByteBuf buf) {
+ int readerIndex = buf.readerIndex();
+ byte b = buf.readByte();
+
+ if (b == -1) {
+ return null;
+ } else {
+ buf.readerIndex(readerIndex);
+ }
+
int len = (int) readVarint(buf, 32);
if (len == 0) {
