| Index: LayoutTests/http/tests/websocket/close_wsh.py
|
| diff --git a/LayoutTests/http/tests/websocket/close_wsh.py b/LayoutTests/http/tests/websocket/close_wsh.py
|
| index 1b02d66267e294ce83977dac64f075981705647c..225aaf5985af23d44bc35899d405892268882630 100644
|
| --- a/LayoutTests/http/tests/websocket/close_wsh.py
|
| +++ b/LayoutTests/http/tests/websocket/close_wsh.py
|
| @@ -29,7 +29,9 @@
|
|
|
|
|
| import logging
|
| -_GOODBYE_MESSAGE = u'Goodbye'
|
| +
|
| +
|
| +from mod_pywebsocket import msgutil
|
|
|
|
|
| def web_socket_do_extra_handshake(request):
|
| @@ -37,16 +39,18 @@ def web_socket_do_extra_handshake(request):
|
|
|
|
|
| def web_socket_transfer_data(request):
|
| - while True:
|
| - line = request.ws_stream.receive_message()
|
| - if line is None:
|
| - return
|
| - if isinstance(line, unicode):
|
| - request.ws_stream.send_message(line, binary=False)
|
| - if line == _GOODBYE_MESSAGE:
|
| + try:
|
| + while True:
|
| + line = request.ws_stream.receive_message()
|
| + if line is None:
|
| return
|
| - else:
|
| - request.ws_stream.send_message(line, binary=True)
|
| + if isinstance(line, unicode):
|
| + request.ws_stream.send_message(line, binary=False)
|
| + else:
|
| + request.ws_stream.send_message(line, binary=True)
|
| + except msgutil.BadOperationException, e:
|
| + # FIXME: Find out what causes this.
|
| + logging.getLogger().error("Exception happened", exc_info=True)
|
|
|
|
|
| def web_socket_passive_closing_handshake(request):
|
|
|