Skip to content
Snippets Groups Projects
Commit a6fa4ae3 authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

Prevent repeated disconnects.

parent 78fd07cb
Branches
No related tags found
No related merge requests found
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment