Skip to content

Commit 36cf366

Browse files
committed
for apache#750 read out the bytes before decoding twice
1 parent 2504876 commit 36cf366

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

sharding-proxy/src/main/java/io/shardingjdbc/proxy/transport/mysql/codec/MySQLPacketCodec.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ protected void doDecode(final ChannelHandlerContext context, final ByteBuf in, f
4545
in.resetReaderIndex();
4646
return;
4747
}
48-
if (readableBytes > realPacketLength) {
49-
out.add(in.readRetainedSlice(payloadLength + MySQLPacket.SEQUENCE_LENGTH));
50-
return;
51-
}
52-
out.add(in);
48+
out.add(in.readRetainedSlice(payloadLength + MySQLPacket.SEQUENCE_LENGTH));
5349
}
5450

5551
@Override

0 commit comments

Comments
 (0)