Skip to content

Commit

Permalink
socket: Only deregister connections that have been registered
Browse files Browse the repository at this point in the history
(imported from commit bfaed299a129bac1e901883f5c6e3339f5a8b688)
  • Loading branch information
zbenjamin committed Nov 12, 2013
1 parent eec195f commit 673f497
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion zerver/lib/socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ def on_message(self, msg):
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:
Expand All @@ -180,6 +179,7 @@ def on_close(self):
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='?')
Expand Down

0 comments on commit 673f497

Please sign in to comment.