Fix bad transition when server sends invalid headers in stream state machine #88
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While triaging #83 we discovered an issue with the stream state machine, where we would not transition the server to
closed
when receiving invalid headers. This is not correct, because at this point the server is in an unrecoverable state from the client's perspective, and we should ignore any subsequent messages.This PR fixes this transition, which was causing an "invalid state" error (or runtime crash in debug mode). It now drops any further messages from the server on the floor, instead of throwing/sending another error message back to the client.
I've also fixed a problem with receiving headers with a 1xx status code: they should be ignored, but we were transitioning to closed states instead.