Skip to content

Commit

Permalink
Fix TCP message reading
Browse files Browse the repository at this point in the history
  • Loading branch information
mmodzelewski committed Oct 17, 2024
1 parent 82f7ac0 commit 16edc49
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,11 @@ protected void decode(ChannelHandlerContext channelHandlerContext, ByteBuf byteB
if (byteBuf.readableBytes() < RESPONSE_INITIAL_BYTES_LENGTH) {
return;
}
byteBuf.markReaderIndex();
var status = byteBuf.readUnsignedIntLE();
var responseLength = byteBuf.readUnsignedIntLE();
if (byteBuf.readableBytes() < responseLength) {
byteBuf.resetReaderIndex();
return;
}
var length = Long.valueOf(responseLength).intValue();
Expand Down

0 comments on commit 16edc49

Please sign in to comment.