From: Eric S. Raymond Date: Sat, 16 Nov 2013 10:11:32 +0000 (-0500) Subject: Meatball-surgery fix for invalid-name bug. X-Git-Tag: 2.0~3 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=82442ed5309e97b5924f1a1ae11e386c4ecf6b97;p=irker.git Meatball-surgery fix for invalid-name bug. 00:07:27 AI0867 | esr: it reproduces on git head │ 00:07:42 AI0867 | ./irk irc://chat.freendoe.net/foo │ 00:07:45 AI0867 | that's sufficient │ 00:08:01 esr | OK, please email me a description of how to │ | reproduce, I'll fix it. │ 00:08:39 esr | Oh. Is therec anything special about that │ | channel? │ 00:08:42 AI0867 | no │ 00:08:48 AI0867 | any incorrect servername will do │ 00:08:56 AI0867 | it then attempts to quit the server │ 00:09:01 AI0867 | and tries to send a QUIT │ 00:09:06 AI0867 | which throws an exception │ 00:09:10 AI0867 | so it tries to quit the server │ --- diff --git a/irkerd b/irkerd index 4e0e24c..2343637 100755 --- a/irkerd +++ b/irkerd @@ -310,7 +310,7 @@ class IRCServerConnection(): def disconnect(self, message=""): if self.socket is None: return - self.quit(message) + # Don't send a QUIT here - causes infinite loop! try: self.socket.shutdown(socket.SHUT_WR) self.socket.close() @@ -412,7 +412,8 @@ class Connection: def handle_disconnect(self): "Server disconnected us for flooding or some other reason." self.connection = None - self.status = "disconnected" + if self.status != "connectfail": + self.status = "disconnected" def handle_kick(self, outof): "We've been kicked." self.status = "handshaking" @@ -479,7 +480,7 @@ class Connection: # space forever would be a memory leak. self.status = "expired" break - elif not self.connection: + elif not self.connection and self.status != "connectfail": # Queue is nonempty but server isn't connected. with self.irker.irc.mutex: self.connection = self.irker.irc.newserver() @@ -500,7 +501,7 @@ class Connection: self.last_xmit = time.time() self.last_ping = time.time() except IRCServerConnectionError: - self.status = "disconnected" + self.status = "connectfail" elif self.status == "handshaking": if time.time() > self.last_xmit + HANDSHAKE_TTL: self.status = "expired"