xwm1992 commented on code in PR #3344:
URL:
https://github.com/apache/incubator-eventmesh/pull/3344#discussion_r1128918966
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/codec/Codec.java:
##########
@@ -74,12 +74,20 @@ public void encode(ChannelHandlerContext ctx, Package pkg,
ByteBuf out) throws E
int headerLength = ArrayUtils.getLength(headerData);
int bodyLength = ArrayUtils.getLength(bodyData);
- int length = 4 + 4 + headerLength + bodyLength;
+ int length = headerLength + bodyLength;
Review Comment:
this line need to change:
`int length = CONSTANT_MAGIC_FLAG.length + VERSION.length + headerLength +
bodyLength;`
##########
eventmesh-common/src/main/java/org/apache/eventmesh/common/protocol/tcp/codec/Codec.java:
##########
@@ -108,14 +116,14 @@ public void decode(ChannelHandlerContext ctx, ByteBuf in,
List<Object> out) thro
final int length = in.readInt();
final int headerLength = in.readInt();
- final int bodyLength = length - 8 - headerLength;
+ final int bodyLength = length - headerLength;
Review Comment:
this line need to change:
`final int bodyLength = length - CONSTANT_MAGIC_FLAG.length - VERSION.length
- headerLength;`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]