Slightly more elegant fix, no need for new connectfail status.
authorEric S. Raymond <esr@thyrsus.com>
Sat, 16 Nov 2013 10:15:18 +0000 (05:15 -0500)
committerEric S. Raymond <esr@thyrsus.com>
Sat, 16 Nov 2013 10:15:18 +0000 (05:15 -0500)
irkerd

diff --git a/irkerd b/irkerd
index 2343637aac85d00fab11cb2ea250896224286f49..fb4aae6dd74cd0f9ed44d5fff8dc28adf9431f0f 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -412,7 +412,7 @@ class Connection:
     def handle_disconnect(self):
         "Server disconnected us for flooding or some other reason."
         self.connection = None
-        if self.status != "connectfail":
+        if self.status != "expired":
             self.status = "disconnected"
     def handle_kick(self, outof):
         "We've been kicked."
@@ -480,7 +480,7 @@ class Connection:
                     # space forever would be a memory leak.
                     self.status = "expired"
                     break
-                elif not self.connection and self.status != "connectfail":
+                elif not self.connection and self.status != "expired":
                     # Queue is nonempty but server isn't connected.
                     with self.irker.irc.mutex:
                         self.connection = self.irker.irc.newserver()
@@ -501,7 +501,7 @@ class Connection:
                             self.last_xmit = time.time()
                             self.last_ping = time.time()
                         except IRCServerConnectionError:
-                            self.status = "connectfail"
+                            self.status = "expired"
                 elif self.status == "handshaking":
                     if time.time() > self.last_xmit + HANDSHAKE_TTL:
                         self.status = "expired"