socket: Initialize client_id to None by default.

This fixes an exception where client_id was never set in an error code
path.  It shouldn't be needed, but I think this makes the code clearer
and this will help in debugging the actual problem.

Related to #753.
This commit is contained in:
Tim Abbott
2016-05-05 14:46:39 -07:00
parent 542af0d6b6
commit 4219a6779f

View File

@@ -72,6 +72,8 @@ class CloseErrorInfo(object):
self.err_msg = err_msg
class SocketConnection(sockjs.tornado.SockJSConnection):
client_id = None # type: str
def on_open(self, info):
log_data = dict(extra='[transport=%s]' % (self.session.transport_name,))
record_request_start_data(log_data)