|
|
Chromium Code Reviews|
Created:
3 years, 11 months ago by Maks Orlovich Modified:
3 years, 11 months ago Reviewers:
mmenke CC:
chromium-reviews, cbentzel+watch_chromium.org Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionHttpServer WebSocket: don't crash on data before server handshake
(Which includes the case of a server delegate which doesn't do anything
with WebSocket requests).
Note: this assumes 860f9bd is in, since otherwise the test
would leak.
BUG=606428
Review-Url: https://codereview.chromium.org/2640363004
Cr-Commit-Position: refs/heads/master@{#445439}
Committed: https://chromium.googlesource.com/chromium/src/+/788a643320ed52bdaf97892a43c505314678157a
Patch Set 1 #Patch Set 2 : HttpServer WebSocket: don't crash if data received before server handshake #
Total comments: 8
Patch Set 3 : Apply review feedback. #
Messages
Total messages: 27 (22 generated)
The CQ bit was checked by morlovich@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
The CQ bit was checked by morlovich@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
Description was changed from ========== HttpServer WebSocket: don't crash on data before server handshake (Which includes the case of a server delegate which doesn't do anything with WebSocket requests). BUG=606428 ========== to ========== HttpServer WebSocket: don't crash on data before server handshake (Which includes the case of a server delegate which doesn't do anything with WebSocket requests). Note: this assumes 860f9bd is in, since otherwise the test would leak. BUG=606428 ==========
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
morlovich@chromium.org changed reviewers: + mmenke@chromium.org
Thanks for finding and fixing this. LGTM, modulo comments. https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.cc File net/server/web_socket.cc (right): https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.c... net/server/web_socket.cc:104: // any further data". If encoder_ is null here, we haven't even sent a nit (x2): |encoder_| is the more common pattern in net/, for class and stack variable names. https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.c... net/server/web_socket.cc:106: // that, so we can reject them guilt-free, especially since we can't nit (x2): Avoid we in comments, due to ambiguity. https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.c... net/server/web_socket.cc:108: Fail(); Hrm...The caller already closes the socket when we return FRAME_CLOSE or FRAME_ERROR. There's no documented API contract here, but digging into the encoder_->DecodeFrame call below, it looks like on errors it does not close the socket, but instead just returns FRAME_ERROR, so I think it's more consistent not to call Fail() here. https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.c... net/server/web_socket.cc:109: return FRAME_CLOSE; FRAME_ERROR seems more accurate.
The CQ bit was checked by morlovich@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.cc File net/server/web_socket.cc (right): https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.c... net/server/web_socket.cc:104: // any further data". If encoder_ is null here, we haven't even sent a On 2017/01/23 16:17:21, mmenke wrote: > nit (x2): |encoder_| is the more common pattern in net/, for class and stack > variable names. Done. I incorrectly assumed this was just for API docs... https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.c... net/server/web_socket.cc:106: // that, so we can reject them guilt-free, especially since we can't On 2017/01/23 16:17:21, mmenke wrote: > nit (x2): Avoid we in comments, due to ambiguity. Rephrased. https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.c... net/server/web_socket.cc:108: Fail(); On 2017/01/23 16:17:21, mmenke wrote: > Hrm...The caller already closes the socket when we return FRAME_CLOSE or > FRAME_ERROR. There's no documented API contract here, but digging into the > encoder_->DecodeFrame call below, it looks like on errors it does not close the > socket, but instead just returns FRAME_ERROR, so I think it's more consistent > not to call Fail() here. Good point, done. This does mean we don't set closed_, but since the connection is closed no one should be able to call into something like WebSocket::Send() anyway. https://codereview.chromium.org/2640363004/diff/20001/net/server/web_socket.c... net/server/web_socket.cc:109: return FRAME_CLOSE; On 2017/01/23 16:17:21, mmenke wrote: > FRAME_ERROR seems more accurate. Done.
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: win_chromium_compile_dbg_ng on master.tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_comp...)
The CQ bit was checked by morlovich@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
The CQ bit was checked by morlovich@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from mmenke@chromium.org Link to the patchset: https://codereview.chromium.org/2640363004/#ps40001 (title: "Apply review feedback.")
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch.
Bot data: {"patchset_id": 40001, "attempt_start_ts": 1485200340212840,
"parent_rev": "608d39b1e2e2666c2a37512452be51309709362e", "commit_rev":
"788a643320ed52bdaf97892a43c505314678157a"}
Message was sent while issue was closed.
Description was changed from ========== HttpServer WebSocket: don't crash on data before server handshake (Which includes the case of a server delegate which doesn't do anything with WebSocket requests). Note: this assumes 860f9bd is in, since otherwise the test would leak. BUG=606428 ========== to ========== HttpServer WebSocket: don't crash on data before server handshake (Which includes the case of a server delegate which doesn't do anything with WebSocket requests). Note: this assumes 860f9bd is in, since otherwise the test would leak. BUG=606428 Review-Url: https://codereview.chromium.org/2640363004 Cr-Commit-Position: refs/heads/master@{#445439} Committed: https://chromium.googlesource.com/chromium/src/+/788a643320ed52bdaf97892a43c5... ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001) as https://chromium.googlesource.com/chromium/src/+/788a643320ed52bdaf97892a43c5... |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
