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

Discard writes made to an aborted uWS response #682

Merged
merged 1 commit into from
May 31, 2023

Conversation

OxleyS
Copy link
Contributor

@OxleyS OxleyS commented May 24, 2023

The kind of change this PR does introduce

  • a bug fix
  • a new feature
  • an update to the documentation
  • a code change that improves performance
  • other

Current behaviour

This bug only exists for polling transport connections running on top of uWS.
If the remote client abruptly disconnects (thus aborting the request) while the server is waiting on an asynchronous operation such as compression, the server may attempt to write a response via the aborted response object. This causes an uncaught exception to be thrown.

New behaviour

Attempts to write to or finalize the aborted response object are now silently discarded instead. While checking for an aborted response at the writing call site is also an option, I feel this approach is both the least likely to regress down the road, and that the desired behavior would be the same in any case.

@darrachequesne darrachequesne merged commit 3144d27 into socketio:main May 31, 2023
@darrachequesne
Copy link
Member

Thanks 👍

@dangerous1990
Copy link

dangerous1990 commented Dec 12, 2023

Good job thanks to fix the bug.
but the error occasionally at write http status 101.
socketio/socket.io#5069
if you have the same issue plz help me.

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.

3 participants