From 5a46032c4e835d38b4fed4ef0f89806654b9d229 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 28 Sep 2012 16:35:14 -0400 Subject: [PATCH] Another anti-buzz delay. --- irkerd | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/irkerd b/irkerd index 905c12d..b5d897d 100755 --- a/irkerd +++ b/irkerd @@ -34,7 +34,7 @@ DISCONNECT_TTL = (24 * 60 * 60) # Time to live, seconds from last connect UNSEEN_TTL = 60 # Time to live, seconds since first request CHANNEL_MAX = 18 # Max channels open per socket (default) ANTI_FLOOD_DELAY = 0.125 # Anti-flood delay after transmissions, seconds -ANTI_BUZZ = 0.09 # Anti-buzz delay after queue-empty check +ANTI_BUZZ_DELAY = 0.09 # Anti-buzz delay after queue-empty check # No user-serviceable parts below this line @@ -141,6 +141,9 @@ class Connection: self.last_xmit = time.time() except irc.client.ServerConnectionError: self.status = "disconnected" + elif self.status == "handshaking": + # Don't buzz on the empty-queue test while we're handshaking + time.sleep(ANTI_BUZZ_DELAY) elif self.queue.empty(): # Queue is empty, at some point we want to time out # the connection rather than holding a socket open in @@ -159,7 +162,7 @@ class Connection: # As long as this is less that the duration of a human # reflex arc it is highly unlikely any human will ever # notice. - time.sleep(ANTI_BUZZ) + time.sleep(ANTI_BUZZ_DELAY) elif self.status == "disconnected" \ and time.time() > self.last_xmit + DISCONNECT_TTL: # Queue is nonempty, but the IRC server might be down. Letting -- 2.26.2