Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tagged message length from int32_t to uint32_t #368

Merged
merged 6 commits into from
Feb 27, 2024

Conversation

Jakio815
Copy link
Collaborator

@Jakio815 Jakio815 commented Feb 26, 2024

The tagged message sends a message length of int32_t. The length should not be negative, so changing it to uint32_t.

It also makes the maximum size of the tagged message from 2GB to 4GB.

By the way, the typescript target already writes in unsigned int 32 type.

msg.writeUInt32LE(value.length, 5);

Copy link
Contributor

@edwardalee edwardalee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Perhaps the comment in net_common.h documentation for MSG_TYPE_TAGGED_MESSAGE should change as follows: It currently reads:

 * The four bytes after that will be the length of the message.

Perhaps it should read:

 * The four bytes after that will be the length of the message (as an unsigned 32-bit int).

@Jakio815 Jakio815 merged commit ec3b6de into main Feb 27, 2024
20 checks passed
@Jakio815 Jakio815 deleted the tagged_message_type branch February 27, 2024 18:26
lhstrh added a commit that referenced this pull request Feb 28, 2024
This reverts commit ec3b6de, reversing
changes made to 5e92613.
@Jakio815 Jakio815 restored the tagged_message_type branch March 11, 2024 16:13
@lhstrh lhstrh added the bugfix label Apr 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants