Currently, WebKit times out in case of Web Socket handshake error (as caught by LayoutTests/websocket/tests/handshake-error.html)
It must close the connection instead.
4 The WebSocket interface
If the "establish a Web Socket connection" algorithm fails, it triggers the "fail the Web Socket connection" algorithm, which then invokes the "close the Web Socket connection" algorithm, which then establishes that the "Web Socket connection is closed", which fires the close event as described below.
Note: this bug was found while examining:
I don't understand what exactly fails here. According to <http://build.webkit.org/waterfall>, all tests currently pass. Does this particular test have identical output in success and failure cases? Or does it only fail with a patch from bug 31465 applied?
Without 31465, the server calls a non-existent method, raises exception, and closes the socket.
With 31645, the server writes an invalid handshake response to the socket.
It seems that the client side can handle the socket closure case properly but not
the invalid response case -- the client times out for the latter.
Sorry, s/31645/31465/g in #3.
Created attachment 44045 [details]
Comment on attachment 44045 [details]