From 1168b4d0b79bd2cfb114efdfd0cec15a21858e13 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 27 Sep 2015 19:18:15 -0700 Subject: [PATCH] irclib: handle disconnections correctly for InspIRCd 2.0 networks The old code, which checked for "Closing Link" in the message, wouldn't have matched InspIRCd's way of closing connections (they send "Closing link" with a lowercase l): DEBUG 2015-09-27T19:15:32 Incoming message (overdrive-irc): ERROR :Closing link: (LilyBot@0::1) [Quit: test] --- src/irclib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/irclib.py b/src/irclib.py index 4d2fa3863..9d763ad9c 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -1278,7 +1278,7 @@ class Irc(IrcCommandDispatcher, log.Firewalled): """Handles ERROR messages.""" log.warning('Error message from %s: %s', self.network, msg.args[0]) if not self.zombie: - if msg.args[0].startswith('Closing Link'): + if msg.args[0].lower().startswith('closing link'): self.driver.reconnect() elif 'too fast' in msg.args[0]: # Connecting too fast. self.driver.reconnect(wait=True)