2011-05-25 Yuta Kitamura <yutak@chromium.org>
authoryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2011 09:52:36 +0000 (09:52 +0000)
committeryutak@chromium.org <yutak@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 25 May 2011 09:52:36 +0000 (09:52 +0000)
commitc576e6c0f95945b88eee7567ff1f189a8a8cdb0c
tree38e5c130db0a84e9ddb2fb06ad08a07ca94299d7
parent6d0071470f40ea4edb976f54808080c2ac87e3ad
2011-05-25  Yuta Kitamura  <yutak@chromium.org>

        Reviewed by Kent Tamura.

        WebSocket: Use fail() when WebSocketChannel has failed
        https://bugs.webkit.org/show_bug.cgi?id=61353

        * http/tests/websocket/tests/frame-length-overflow-expected.txt:
        Added a new console message.
2011-05-25  Yuta Kitamura  <yutak@chromium.org>

        Reviewed by Kent Tamura.

        WebSocket: Use fail() when WebSocketChannel has failed
        https://bugs.webkit.org/show_bug.cgi?id=61353

        An existing error message has been modified, but it is impossible
        to test this message in LayoutTests because it is only shown when
        memory allocation has failed, which is hard to reproduce reliably.

        One new message has been added. It is covered by an existing test
        http/tests/websocket/tests/frame-length-overflow.html.

        There is no other change in behavior. No new tests are added.

        * websockets/WebSocketChannel.cpp:
        (WebCore::WebSocketChannel::fail):
        Do not close if we know the socket stream is already closed. This does not
        change the behavior, because SocketStreamBase does nothing if it is already
        closed.
        (WebCore::WebSocketChannel::didOpen):
        (WebCore::WebSocketChannel::didReceiveData):
        We need to set m_shouldDiscardReceivedData to true before calling fail(),
        so I moved the error message from appendToBuffer() to here.
        The error message was rephrased in order to improve readability.
        (WebCore::WebSocketChannel::appendToBuffer):
        Unnested the code.
        (WebCore::WebSocketChannel::processBuffer):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@87282 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/websocket/tests/frame-length-overflow-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/websockets/WebSocketChannel.cpp