Skip to content

Fix incorrect sequence id setting in thrift message begin#2984

Merged
wwbmmm merged 1 commit into
apache:masterfrom
chenBright:fix_thrift_seq_id
Jun 7, 2025
Merged

Fix incorrect sequence id setting in thrift message begin#2984
wwbmmm merged 1 commit into
apache:masterfrom
chenBright:fix_thrift_seq_id

Conversation

@chenBright

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Issue Number:

Problem Summary:

WriteThriftMessageBegin(char* buf,
const std::string& method_name,
::apache::thrift::protocol::TMessageType mtype,
uint32_t seq_id) {
char* p = buf;
*(uint32_t*)p = htonl(THRIFT_HEAD_VERSION_1 | (((uint32_t)mtype) & 0x000000FF));
p += 4;
*(uint32_t*)p = htonl(method_name.size());
p += 4;
memcpy(p, method_name.data(), method_name.size());
p += method_name.size();
*p = htonl(seq_id);

p is char*, so *p = htonl(seq_id); can not set seq_id(a uint32_t variable) to buf.

What is changed and the side effects?

Changed:

Side effects:

  • Performance effects:

  • Breaking backward compatibility:


Check List:

@wwbmmm wwbmmm merged commit 8f7a402 into apache:master Jun 7, 2025
15 checks passed
@chenBright chenBright deleted the fix_thrift_seq_id branch June 7, 2025 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants