Prevent repeated disconnects.
authorEric S. Raymond <esr@thyrsus.com>
Fri, 5 Oct 2012 14:00:13 +0000 (10:00 -0400)
committerEric S. Raymond <esr@thyrsus.com>
Fri, 5 Oct 2012 14:00:13 +0000 (10:00 -0400)
irkerd

diff --git a/irkerd b/irkerd
index 8c512e27d3bac1257522aa10dd8ac3137737a91a..042ae29cdd48794a0336bf2fbffdbf75ee5fdc0f 100755 (executable)
--- a/irkerd
+++ b/irkerd
@@ -200,8 +200,9 @@ class Connection:
                     # the connection rather than holding a socket open in
                     # the server forever.
                     now = time.time()
-                    if now > self.last_xmit + XMIT_TTL \
-                           or now > self.last_ping + PING_TTL:
+                    if (now > self.last_xmit + XMIT_TTL \
+                           or now > self.last_ping + PING_TTL) \
+                           and self.status != "disconnected":
                         self.irker.debug(1, "timing out inactive connection to %s at %s" % (self.servername, time.asctime()))
                         self.connection.context = None
                         self.connection.quit("transmission timeout")