Summary: | WebSocket: Call WebSocketChannel::fail() when WebSocketHandshake has failed | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Yuta Kitamura <yutak> | ||||
Component: | WebCore Misc. | Assignee: | Yuta Kitamura <yutak> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | ap, commit-queue, tkent, ukai | ||||
Priority: | P2 | ||||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Bug Depends on: | 61851 | ||||||
Bug Blocks: | 61115 | ||||||
Attachments: |
|
Description
Yuta Kitamura
2011-06-01 00:55:37 PDT
Created attachment 95561 [details]
Patch
Comment on attachment 95561 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=95561&action=review > Source/WebCore/websockets/WebSocketChannel.cpp:337 > - if (!m_closed) > - m_handle->disconnect(); > + fail(m_handshake.failureReason()); This looks a behavior change. fail() calls m_handle->close(), not m_handle->disconnect(), right? Comment on attachment 95561 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=95561&action=review >> Source/WebCore/websockets/WebSocketChannel.cpp:337 >> + fail(m_handshake.failureReason()); > > This looks a behavior change. > fail() calls m_handle->close(), not m_handle->disconnect(), right? Good point. This sounds like a bug of fail(), rather than of this patch. I should have used m_handle->disconnect() in fail(), because we don't have to wait for unsent data to be sent (difference between m_handle->close() and m_handle->disconnect() is that the former does not close the connection until the socket finishes to send all data while the latter immediately closes the connection). I will create a new bug and fix this. Comment on attachment 95561 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=95561&action=review >>> Source/WebCore/websockets/WebSocketChannel.cpp:337 >>> + fail(m_handshake.failureReason()); >> >> This looks a behavior change. >> fail() calls m_handle->close(), not m_handle->disconnect(), right? > > Good point. > > This sounds like a bug of fail(), rather than of this patch. I should have used m_handle->disconnect() in fail(), because we don't have to wait for unsent data to be sent (difference between m_handle->close() and m_handle->disconnect() is that the former does not close the connection until the socket finishes to send all data while the latter immediately closes the connection). > > I will create a new bug and fix this. Now m_handle->disconnect() is used in fail(), so this line is no longer a behavior change. Comment on attachment 95561 [details]
Patch
ok!
Comment on attachment 95561 [details] Patch Clearing flags on attachment: 95561 Committed r87883: <http://trac.webkit.org/changeset/87883> All reviewed patches have been landed. Closing bug. |