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

Avoid delivering websocket frames twice on EOF. #368

Merged
merged 1 commit into from
Apr 27, 2018

Conversation

Lukasa
Copy link
Contributor

@Lukasa Lukasa commented Apr 27, 2018

Motivation:

Unfortunately as a result of #108 the WebSocketFrameDecoder can emit a
WebSocketFrame more than once if the user closes the connection in
channelRead, or any other callback while decode() is on the call stack.
This is obviously less than ideal, as it can allow multiple delivery of
frames.

Modifications:

Given WebSocketFrameDecoder a no-op implementation of decodeLast.

Result:

No multi-delivery of frames.

@Lukasa Lukasa added the semver/patch No public API change. label Apr 27, 2018
@Lukasa Lukasa added this to the 1.6.0 milestone Apr 27, 2018
Motivation:

Unfortunately as a result of apple#108 the WebSocketFrameDecoder can emit a
WebSocketFrame more than once if the user closes the connection in
channelRead, or any other callback while decode() is on the call stack.
This is obviously less than ideal, as it can allow multiple delivery of
frames.

Modifications:

Given WebSocketFrameDecoder a no-op implementation of decodeLast.

Result:

No multi-delivery of frames.
Copy link
Member

@weissi weissi left a comment

Choose a reason for hiding this comment

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

Lgtm

@Lukasa Lukasa merged commit 708a62d into apple:master Apr 27, 2018
@Lukasa Lukasa deleted the cb-websocket-multiframe branch April 27, 2018 10:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants