Skip to content

Commit

Permalink
Fix Bug that using not-English characters in message file will cause …
Browse files Browse the repository at this point in the history
…this topic can't received (#142)
  • Loading branch information
xqe2011 authored Mar 2, 2020
1 parent b80f709 commit af5d458
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/tcpros_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const tcpNoDelayField = 'tcp_nodelay=1';
function serializeStringFields(fields) {
let length = 0;
fields.forEach((field) => {
length += (field.length + 4);
length += (Buffer.byteLength(field) + 4);
});
let buffer = new Buffer(4 + length);
let offset = base_serializers.uint32(length, buffer, 0);
Expand Down

0 comments on commit af5d458

Please sign in to comment.