aloyszhang commented on code in PR #11411:
URL: https://github.com/apache/inlong/pull/11411#discussion_r1815898575
##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/source/ServerMessageHandler.java:
##########
@@ -558,11 +558,14 @@ private void procBinHeartbeatMsg(BaseSource source,
Channel channel,
*/
public static ByteBuf buildBinMsgRspPackage(String attrs, long uniqVal) {
// calculate total length
- // binTotalLen = mstType + uniq + attrsLen + attrs + magic
- int binTotalLen = 1 + 4 + 2 + 2;
+ int attrsLen = 0;
+ byte[] byTeAttrs = null;
if (null != attrs) {
- binTotalLen += attrs.length();
+ byTeAttrs = attrs.getBytes(StandardCharsets.UTF_8);
+ attrsLen = byTeAttrs.length;
}
+ // binTotalLen = mstType + uniq + attrsLen + attrs + magic
+ int binTotalLen = 1 + 4 + 2 + 2 + attrsLen;
Review Comment:
please describe the length of every element in the correct order
--
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]