3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

classes: really fix KeyError crashes on duplicate QUIT

This commit is contained in:
James Lu 2018-04-27 20:48:38 -07:00
parent 8eba402a33
commit b46ab844fe

View File

@ -589,14 +589,13 @@ class PyLinkNetworkCore(structures.CamelCaseToSnakeCase):
del self.channels[c]
sid = self.get_server(numeric)
log.debug('Removing client %s from self.users', numeric)
log.debug('(%s) Removing client %s from users index', self.name, numeric)
try:
del self.users[numeric]
self.servers[sid].users.discard(numeric)
except KeyError:
log.warning('(%s) Failed to remove %r from users index - possible desync or timing issue? (stray QUIT after KILL)',
self.name, numeric, exc_info=True)
log.debug('Removing client %s from self.servers[%s].users', numeric, sid)
self.servers[sid].users.discard(numeric)
## State checking functions
def nick_to_uid(self, nick):