From 9d9b5e26eaa7c1ed61957ca212a1cb5b1aa71074 Mon Sep 17 00:00:00 2001 From: Mikhail Korobov Date: Wed, 4 May 2011 21:17:51 +0600 Subject: [PATCH] Better error handling for exceptions in on_message for websockets: avoid extra IOErrors --- tornado/websocket.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tornado/websocket.py b/tornado/websocket.py index 14073bd4..696a178d 100644 --- a/tornado/websocket.py +++ b/tornado/websocket.py @@ -191,6 +191,7 @@ class WebSocketHandler(tornado.web.RequestHandler): if not self.client_terminated: self.async_callback(self.on_message)( frame[:-1].decode("utf-8", "replace")) + if not self.client_terminated: self._receive_message() def _on_length_indicator(self, byte):