socket: Only deregister connections that have been registered

(imported from commit bfaed299a129bac1e901883f5c6e3339f5a8b688)
This commit is contained in:
Zev Benjamin 2013-11-08 17:13:55 -05:00
parent eec195f421
commit 673f497a6f
1 changed files with 1 additions and 1 deletions

View File

@ -171,7 +171,6 @@ class SocketConnection(sockjs.tornado.SockJSConnection):
fake_message_sender)
def on_close(self):
deregister_connection(self)
log_data = dict(extra='[transport=%s]' % (self.session.transport_name,))
record_request_start_data(log_data)
if self.session.user_profile is None:
@ -180,6 +179,7 @@ class SocketConnection(sockjs.tornado.SockJSConnection):
client_name='?', status_code=408,
error_content='Timeout while waiting for authentication')
else:
deregister_connection(self)
write_log_line(log_data, path='/socket/close', method='SOCKET',
remote_ip=self.session.conn_info.ip, email='unknown',
client_name='?')