2010-05-20 Fumitoshi Ukai <ukai@chromium.org>
authorukai@chromium.org <ukai@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 May 2010 03:06:42 +0000 (03:06 +0000)
committerukai@chromium.org <ukai@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 21 May 2010 03:06:42 +0000 (03:06 +0000)
commit90b25265960dff972d3d91db7b0be69aa376cb65
treed3143076ed86c12ee6c61d0bc7f3cc5c86a738f1
parentc02bc58f5a4e0110f92d91537023f03035c402e0
2010-05-20  Fumitoshi Ukai  <ukai@chromium.org>

        Reviewed by Alexey Proskuryakov.

        WebSocket handshake incompatible change in draft-hixie-thewebsocketprotocol-76
        https://bugs.webkit.org/show_bug.cgi?id=35572

        Fix LayoutTests for new WebSocket protocol.
        It requires https://bugs.webkit.org/show_bug.cgi?id=38034 to pass websocket tests.

        * websocket/tests/handshake-error-expected.txt: Update expected data.
        * websocket/tests/handshake-error_wsh.py: Without CRLF, the wsh will sends "ThisWillCauseHandshakeErrorHTTP/1.1 101 WebSocket Protocol Handshake\r\n", which is legal for the first line of draft 76 WebSocket opening handshake. (4.1 Opening Handhshake, step 28 to 30).  To fail handshake, it needs \r\n.
        * websocket/tests/long-invalid-header-expected.txt:  Originally, it expects Upgrade header after status line.  In draft 76, order is not important.  But "pppp..\r\n" would fail because it misses ":" (end of name) before \r.
2010-05-20  Fumitoshi Ukai  <ukai@chromium.org>

        Reviewed by Alexey Proskuryakov.

        WebSocket handshake incompatible change in draft-hixie-thewebsocketprotocol-76
        https://bugs.webkit.org/show_bug.cgi?id=35572

        WebSocket opening handshake is changed.  New protocol draft could be found at http://www.whatwg.org/specs/web-socket-protocol/
        It requires https://bugs.webkit.org/show_bug.cgi?id=38034 to pass websocket tests.

        * websockets/WebSocketHandshake.cpp:
        (WebCore::extractResponseCode):
        add lineLength parameter to return length of status line.
        (WebCore::hostName): Added.
        (WebCore::generateSecWebSocketKey): Added.
        (WebCore::generateKey3): Added.
        (WebCore::setChallengeNumber): Added.
        (WebCore::generateChallengeResponseExpected): Added.
        (WebCore::WebSocketHandshake::WebSocketHandshake):
         generate challenge response key and expected data.
        (WebCore::WebSocketHandshake::clientLocation):
         use hostName.
        (WebCore::WebSocketHandshake::clientHandshakeMessage):
         changed for draft 76 spec.
        (WebCore::WebSocketHandshake::clientHandshakeRequest):
        (WebCore::WebSocketHandshake::readServerHandshake):
         changed for draft 76 spec.
         m_mode is managed in this method.
        (WebCore::WebSocketHandshake::readHTTPHeaders):
         change error log messages.
        (WebCore::WebSocketHandshake::processHeaders):
         chagned for draft 76 spec.
        (WebCore::WebSocketHandshake::checkResponseHeaders):
         return boolean whether response header is ok or not and not change m_mode in it.
        * websockets/WebSocketHandshake.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@59903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/websocket/tests/handshake-error-expected.txt
LayoutTests/websocket/tests/handshake-error_wsh.py
LayoutTests/websocket/tests/long-invalid-header-expected.txt
WebCore/ChangeLog
WebCore/websockets/WebSocketHandshake.cpp
WebCore/websockets/WebSocketHandshake.h