Changeset 87876 in webkit


Ignore:
Timestamp:
Jun 1, 2011 7:53:13 PM (13 years ago)
Author:
yutak@chromium.org
Message:

2011-06-01 Yuta Kitamura <yutak@chromium.org>

Reviewed by Kent Tamura.

WebSocket: WebSocketChannel::fail() should close the connection immediately
https://bugs.webkit.org/show_bug.cgi?id=61851

The effect of this change is almost unobservable. The difference between m_handle->close() and
m_handle->disconnect() is that the former does not close the connection if the handle has
unsent data while the latter immediately closes the connection regardless of unsent data.
Usually a socket stream handle does not have unsent data, and even if it has any, it is hard
for user scripts to observe the difference between close() and disconnect() (it should take some time
for onclose() to be called if there are any unsent data, but there ought to be no other difference
in user scripts' perspective).

No new tests are added, because writing a test for this issue is not feasible due to the above reason.

  • websockets/WebSocketChannel.cpp: (WebCore::WebSocketChannel::fail): Use m_handle->disconnect() instead of m_handle->close().
Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r87875 r87876  
     12011-06-01  Yuta Kitamura  <yutak@chromium.org>
     2
     3        Reviewed by Kent Tamura.
     4
     5        WebSocket: WebSocketChannel::fail() should close the connection immediately
     6        https://bugs.webkit.org/show_bug.cgi?id=61851
     7
     8        The effect of this change is almost unobservable. The difference between m_handle->close() and
     9        m_handle->disconnect() is that the former does not close the connection if the handle has
     10        unsent data while the latter immediately closes the connection regardless of unsent data.
     11        Usually a socket stream handle does not have unsent data, and even if it has any, it is hard
     12        for user scripts to observe the difference between close() and disconnect() (it should take some time
     13        for onclose() to be called if there are any unsent data, but there ought to be no other difference
     14        in user scripts' perspective).
     15
     16        No new tests are added, because writing a test for this issue is not feasible due to the above reason.
     17
     18        * websockets/WebSocketChannel.cpp:
     19        (WebCore::WebSocketChannel::fail): Use m_handle->disconnect() instead of m_handle->close().
     20
    1212011-06-01  Abhishek Arya  <inferno@chromium.org>
    222
  • trunk/Source/WebCore/websockets/WebSocketChannel.cpp

    r87674 r87876  
    137137        m_context->addMessage(JSMessageSource, LogMessageType, ErrorMessageLevel, reason, 0, m_handshake.clientOrigin(), 0);
    138138    if (m_handle && !m_closed)
    139         m_handle->close(); // Will call didClose().
     139        m_handle->disconnect(); // Will call didClose().
    140140}
    141141
Note: See TracChangeset for help on using the changeset viewer.