-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Limit the max request size to be accepted #780
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
Conversation
LGTM. |
@tamird Yes, it should be. I will do an entire pass on this file in a separate PR. Most of tests exist before codes became stringers. |
} | ||
} | ||
if len(d) > maxMsgSize { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this validation be done before decompressing the message?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
additionally, it seems the message size validation is also being done in the parser: https://github.com/grpc/grpc-go/blob/master/rpc_util.go#L253
Make it consistent with Java and C++ impl.
also fixes #785
TODO: client side memory guard.