aloyszhang commented on code in PR #11411:
URL: https://github.com/apache/inlong/pull/11411#discussion_r1815898766


##########
inlong-dataproxy/dataproxy-source/src/main/java/org/apache/inlong/dataproxy/source/ServerMessageHandler.java:
##########
@@ -656,15 +664,16 @@ private ByteBuf buildTxtMsgRspPackage(MsgType msgType, 
String attrs, AbsV0MsgCod
      */
     private ByteBuf buildHBRspPackage(byte[] attrData, byte version, int 
loadValue) {
         // calculate total length
-        // binTotalLen = mstType + dataTime + body_ver + bodyLen + body + 
attrsLen + attrs + magic
-        int binTotalLen = 1 + 4 + 1 + 4 + 2 + 2 + 2;
+        int attrsLen = 0;
         if (null != attrData) {
-            binTotalLen += attrData.length;
+            attrsLen = attrData.length;
         }
         // check load value
         if (loadValue == 0 || loadValue == (-1)) {
             loadValue = 0xffff;
         }
+        // binTotalLen = mstType + dataTime + version + bodyLen + body + 
attrsLen + attrs + magic
+        int binTotalLen = 1 + 4 + 1 + 4 + 2 + 2 + 2 + attrsLen;

Review Comment:
   ditto



-- 
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]

Reply via email to