-
Notifications
You must be signed in to change notification settings - Fork 840
fix rpcchainvm handling for arbitrary length http body #3910
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
ac8fb6d to
11b1ef5
Compare
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
11b1ef5 to
8511ffd
Compare
| if err != nil { | ||
| return 0, err | ||
| } |
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.
I think it's fine for us to just return the error here. io.EOF is a special error for both grpc and io.Reader (ref). io.EOF's invariants on io.Reader are particularly confusing though.
|
Also - linting seems to be failing |
Co-authored-by: Stephen Buttolph <stephen@avalabs.org> Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
Signed-off-by: Joshua Kim <20001595+joshua-kim@users.noreply.github.com>
tsachiherman
left a comment
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.
looks functionally correct to me.
Why this should be merged
Fixes a bug in rpcchainvm where a arbitrary length http body will hang when attempting to copy the body into protobuf.
How this works
Instead of copying the body into a proto message, wrap the http body in an implementation of
io.Readerthat streams the message body.How this was tested
Added a regression test
Need to be documented in RELEASES.md?
Yes