• ukai@chromium.org's avatar
    2010-05-20 Fumitoshi Ukai <ukai@chromium.org> · 8c8c2c00
    ukai@chromium.org authored
            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: http://svn.webkit.org/repository/webkit/trunk@59903 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    8c8c2c00
ChangeLog 1.09 MB