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

inspector: handle socket close before close frame #12937

Merged
merged 0 commits into from May 12, 2017

Conversation

@eugeneo
Copy link
Contributor

commented May 9, 2017

This change handles clients that respond to close request with a TCP
close instead of close response.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

inpsector: updated the protocol handler and added a test case.

@eugeneo

This comment has been minimized.

Copy link
Contributor Author

commented May 9, 2017

At least one popular frontend is not properly following WS protocol specification, this change protects from such clients.

@jasnell
jasnell approved these changes May 9, 2017
@adnsio
adnsio approved these changes May 10, 2017
src/inspector_socket.cc Outdated
@@ -335,6 +335,10 @@ static void websockets_data_cb(uv_stream_t* stream, ssize_t nread,
if (!inspector->shutting_down && inspector->ws_state->read_cb) {
inspector->ws_state->read_cb(stream, nread, nullptr);
}
if (inspector->ws_state->close_sent
&& !inspector->ws_state->received_close) {

This comment has been minimized.

Copy link
@cjihrig

cjihrig May 10, 2017

Contributor

Can you move the && to the previous line.

This comment has been minimized.

Copy link
@eugeneo

eugeneo May 10, 2017

Author Contributor

Done.

@eugeneo

This comment has been minimized.

Copy link
Contributor Author

commented May 12, 2017

@cjihrig I have addressed the comment. Please take another look.

@eugeneo

This comment has been minimized.

Copy link
Contributor Author

commented May 12, 2017

@eugeneo eugeneo closed this May 12, 2017

@eugeneo eugeneo deleted the eugeneo:broken_close branch May 12, 2017

@eugeneo eugeneo merged commit 7c3a23b into nodejs:master May 12, 2017

@eugeneo

This comment has been minimized.

Copy link
Contributor Author

commented May 12, 2017

Landed as 7c3a23b

anchnk pushed a commit to anchnk/node that referenced this pull request May 19, 2017
inspector: handle socket close before close frame
This change handles clients that respond to close request with a TCP
close instead of close response.

PR-URL: nodejs#12937
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
@jasnell jasnell referenced this pull request May 28, 2017
@gibfahn gibfahn referenced this pull request Jun 15, 2017
2 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.