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

Do not discard remaining data when cancelling h2c upgrade [Fixes #4643] #6300

Merged
merged 1 commit into from
Oct 8, 2021

Conversation

yawkat
Copy link
Member

@yawkat yawkat commented Oct 7, 2021

#4643 is caused by removing the HttpServerCodec from the pipeline when there is no upgrade request.

In normal operation, the getHandlerForProtocol(HTTP_1_1) will return a new HttpServerCodec that takes over decoding. However, when the request is processed, the old HttpServerCodec may not yet have completed reading all data, and removing it causes that data to be lost.

This fix instead reuses the existing HttpServerCodec. We also have to carefully place the other relevant handlers around it in the pipeline. It would be more convenient if we could simply remove it and then readd it, but netty does not support that unfortunately.

@yawkat yawkat removed the request for review from jameskleeh October 8, 2021 07:21
@yawkat yawkat merged commit af4c868 into 3.1.x Oct 8, 2021
@yawkat yawkat deleted the discard-data-0 branch October 8, 2021 07:21
@yawkat yawkat added this to the 3.1.0 milestone Oct 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants