]> git.ipfire.org Git - thirdparty/tornado.git/commit
Catch StreamClosedErrors in WebSocketHandler and abort.
authorBen Darnell <ben@bendarnell.com>
Thu, 6 Jun 2013 01:43:16 +0000 (21:43 -0400)
committerBen Darnell <ben@bendarnell.com>
Thu, 6 Jun 2013 01:43:16 +0000 (21:43 -0400)
commit60693e011cc0602d83a29ac37fa7263eda107f61
tree2861657664a7f9c2ce6dfbfd93b7bd15f45b6ca0
parentb61bc5a79c6421a5dd36e7aeaae7c1f516c8c6c5
Catch StreamClosedErrors in WebSocketHandler and abort.

When the stream is closed with buffered data, the close callback won't
be run until all buffered data is consumed, but any attempt to write
to the stream will fail, as will reading past the end of the buffer.
This requires a try/except around each read or write, analogous to the
one introduced in HTTPServer in commit 3258726f.

Closes #604.
Closes #661.
tornado/test/websocket_test.py
tornado/websocket.py