RESOLVED FIXED 61841
WebSocket: Call WebSocketChannel::fail() when WebSocketHandshake has failed
https://bugs.webkit.org/show_bug.cgi?id=61841
Summary WebSocket: Call WebSocketChannel::fail() when WebSocketHandshake has failed
Yuta Kitamura
Reported 2011-06-01 00:55:37 PDT
This is the last part of bug 61115.
Attachments
Patch (15.73 KB, patch)
2011-06-01 01:28 PDT, Yuta Kitamura
no flags
Yuta Kitamura
Comment 1 2011-06-01 01:28:16 PDT
Kent Tamura
Comment 2 2011-06-01 01:39:28 PDT
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?
Yuta Kitamura
Comment 3 2011-06-01 02:39:46 PDT
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.
Yuta Kitamura
Comment 4 2011-06-01 20:09:15 PDT
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.
Kent Tamura
Comment 5 2011-06-01 20:15:30 PDT
Comment on attachment 95561 [details] Patch ok!
WebKit Commit Bot
Comment 6 2011-06-02 01:12:17 PDT
Comment on attachment 95561 [details] Patch Clearing flags on attachment: 95561 Committed r87883: <http://trac.webkit.org/changeset/87883>
WebKit Commit Bot
Comment 7 2011-06-02 01:12:22 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.