You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by "gosonzhang (via GitHub)" <gi...@apache.org> on 2024/10/25 00:51:47 UTC
[PR] [INLONG-11410][DataProxy] Fixed the bug of excessive packet length when Go SDK receives DataProxy response [inlong]
gosonzhang opened a new pull request, #11411:
URL: https://github.com/apache/inlong/pull/11411
Fixes #11410
Fill in the length of the corresponding package attribute according to the actual setting value
--
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: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [INLONG-11410][DataProxy] Fixed the bug of excessive packet length when Go SDK receives DataProxy response [inlong]
Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [INLONG-11410][DataProxy] Fixed the bug of excessive packet length when Go SDK receives DataProxy response [inlong]
Posted by "aloyszhang (via GitHub)" <gi...@apache.org>.
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: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [INLONG-11410][DataProxy] Fixed the bug of excessive packet length when Go SDK receives DataProxy response [inlong]
Posted by "gosonzhang (via GitHub)" <gi...@apache.org>.
gosonzhang merged PR #11411:
URL: https://github.com/apache/inlong/pull/11411
--
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: commits-unsubscribe@inlong.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org