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

Issue #5170 - fix NPE during websocket upgrade #5213

Merged
merged 3 commits into from Sep 2, 2020

Conversation

lachlan-roberts
Copy link
Contributor

Closes #5170

During the WebSocket client upgrade, if the upgrade response completes before the upgrade request then we NPE or potentially just lose the initial bytes of the websocket connection which would corrupt or lose the initial websocket frames.

This change makes it so during an upgrade we do not release the network buffer in the HttpReceiverOverHttp until onUpgradeFrom() is called. This prevents the NPE and we do not lose the data for the initial websocket buffer.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
Copy link
Contributor

@gregw gregw left a comment

Choose a reason for hiding this comment

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

The main part thrust of this LGTM, but I'm a little concerned about the change in the upgrade test.

Signed-off-by: Lachlan Roberts <lachlan@webtide.com>
@lachlan-roberts lachlan-roberts merged commit cdb12b4 into jetty-10.0.x Sep 2, 2020
@lachlan-roberts lachlan-roberts deleted the jetty-10.0.x-5170-HttpUpgradeBuffer branch September 2, 2020 08:00
lachlan-roberts referenced this pull request Sep 21, 2020
Issue #5170 - fix upgrade bug in HttpReceiverOverHTTP
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.

NullPointerException in HttpReceiverOverHTTP during WebSocket client Upgrade
3 participants