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

codec: check serialization result length #496

Open
wants to merge 7 commits into
base: v0.5.x
Choose a base branch
from

Conversation

BusyJay
Copy link
Member

@BusyJay BusyJay commented Nov 17, 2020

grpc c core can only handle message that is not larger than 4GiB.

This is a cherry-pick of #495.

grpc c core can only handle message that is not larger than 4GiB.

Signed-off-by: Jay Lee <[email protected]>
Signed-off-by: Jay Lee <[email protected]>
hicqu
hicqu previously approved these changes Nov 24, 2020
src/codec.rs Outdated
t.write_to_vec(buf).unwrap()
pub fn ser<T: Message>(t: &T, buf: &mut Vec<u8>) -> Result<()> {
t.write_to_vec(buf)?;
if buf.len() <= u32::MAX as usize {
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment to explain that the source of this number is from https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md

Signed-off-by: Jay Lee <[email protected]>
hunterlxt
hunterlxt previously approved these changes Nov 24, 2020
@hunterlxt
Copy link
Member

The lint check is failed.

Signed-off-by: Jay Lee <[email protected]>
@BusyJay
Copy link
Member Author

BusyJay commented Nov 25, 2020

PTAL

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.

3 participants