mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 15:03:34 +00:00
socket: Only deregister connections that have been registered
(imported from commit bfaed299a129bac1e901883f5c6e3339f5a8b688)
This commit is contained in:
@@ -171,7 +171,6 @@ class SocketConnection(sockjs.tornado.SockJSConnection):
|
|||||||
fake_message_sender)
|
fake_message_sender)
|
||||||
|
|
||||||
def on_close(self):
|
def on_close(self):
|
||||||
deregister_connection(self)
|
|
||||||
log_data = dict(extra='[transport=%s]' % (self.session.transport_name,))
|
log_data = dict(extra='[transport=%s]' % (self.session.transport_name,))
|
||||||
record_request_start_data(log_data)
|
record_request_start_data(log_data)
|
||||||
if self.session.user_profile is None:
|
if self.session.user_profile is None:
|
||||||
@@ -180,6 +179,7 @@ class SocketConnection(sockjs.tornado.SockJSConnection):
|
|||||||
client_name='?', status_code=408,
|
client_name='?', status_code=408,
|
||||||
error_content='Timeout while waiting for authentication')
|
error_content='Timeout while waiting for authentication')
|
||||||
else:
|
else:
|
||||||
|
deregister_connection(self)
|
||||||
write_log_line(log_data, path='/socket/close', method='SOCKET',
|
write_log_line(log_data, path='/socket/close', method='SOCKET',
|
||||||
remote_ip=self.session.conn_info.ip, email='unknown',
|
remote_ip=self.session.conn_info.ip, email='unknown',
|
||||||
client_name='?')
|
client_name='?')
|
||||||
|
|||||||
Reference in New Issue
Block a user