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

WebSockets Next: CloseReason - fix NPE if connection terminated abruptly #42282

Merged
merged 1 commit into from
Aug 2, 2024

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented Aug 2, 2024

- fix invocation of OnClose callback with a CloseReason param
- resolves quarkusio#42271
@mkouba mkouba requested a review from geoand August 2, 2024 06:55
@geoand geoand added triage/waiting-for-ci Ready to merge when CI successfully finishes triage/backport labels Aug 2, 2024
Short code = ws.closeStatusCode();
if (code == null) {
// This could happen if the connection is terminated abruptly
return CloseReason.INTERNAL_SERVER_ERROR;
Copy link
Member

Choose a reason for hiding this comment

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

Does it make sense to return internal server error in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, it's kind of an internal server error. Also I did not find a better code in the list defined by the spec: https://datatracker.ietf.org/doc/html/rfc6455#section-7.4.1. There is 1006 but it's reserved and has a special meaning.

Copy link

quarkus-bot bot commented Aug 2, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 983b8bf.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@gsmet gsmet merged commit 459ea4e into quarkusio:main Aug 2, 2024
20 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.14 - main milestone Aug 2, 2024
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Aug 2, 2024
@gsmet gsmet modified the milestones: 3.14 - main, 3.13.1 Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NPE in websockets-next
3 participants