From 1f0426d7ff72243d3e0336c19ae98d5806189020 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 10 Oct 2015 14:58:52 -0700 Subject: [PATCH] ts6: fixes to SQUIT handling --- protocols/ts6.py | 2 +- protocols/ts6_common.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/protocols/ts6.py b/protocols/ts6.py index 5a98b9b..0049fcc 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -288,7 +288,7 @@ class TS6Protocol(TS6BaseProtocol): def squitServer(self, source, target, text='No reason given'): """SQUITs a PyLink server.""" # -> SQUIT 9PZ :blah, blah - self.irc.send('SQUIT %s :%s' % (target, text)) + self._send(source, 'SQUIT %s :%s' % (target, text)) self.handle_squit(source, 'SQUIT', [target, text]) def connect(self): diff --git a/protocols/ts6_common.py b/protocols/ts6_common.py index 2b40961..ad64030 100644 --- a/protocols/ts6_common.py +++ b/protocols/ts6_common.py @@ -162,8 +162,10 @@ class TS6BaseProtocol(Protocol): # :70M SQUIT 1ML :Server quit by GL!gl@0::1 split_server = args[0] affected_users = [] - log.info('(%s) Netsplit on server %s', self.irc.name, split_server) - assert split_server in self.irc.servers, "Tried to split a server (%s) that didn't exist!" % split_server + log.debug('(%s) Splitting server %s (reason: %s)', self.irc.name, split_server, args[-1]) + if split_server not in self.irc.servers: + log.warning("(%s) Tried to split a server (%s) that didn't exist!", self.irc.name, split_server) + return # Prevent RuntimeError: dictionary changed size during iteration old_servers = self.irc.servers.copy() for sid, data in old_servers.items():