Try to prevent the ping loops we got in earlier.

This commit is contained in:
Jeremy Fincher 2003-12-12 12:29:02 +00:00
parent 8f777db9f9
commit c432a93afb

View File

@ -420,6 +420,7 @@ class Irc(IrcCommandDispatcher):
self._nickmods = copy.copy(conf.nickmods)
self.lastTake = 0
self.server = None
self.got376 = False
self.fastqueue = smallqueue()
self.lastping = time.time()
self.outstandingPing = False
@ -436,6 +437,7 @@ class Irc(IrcCommandDispatcher):
self.state.reset()
self.queue.reset()
self.server = None
self.got376 = False
self.lastping = time.time()
self.outstandingPing = False
self.fastqueue = queue()
@ -489,7 +491,7 @@ class Irc(IrcCommandDispatcher):
else:
self.lastTake = now
msg = self.queue.dequeue()
elif now > (self.lastping + conf.pingInterval):
elif now > (self.lastping + conf.pingInterval) and self.got376:
if self.outstandingPing:
s = 'Reconnecting to %s, ping not replied to.' % self.server
log.warning(s)
@ -549,6 +551,9 @@ class Irc(IrcCommandDispatcher):
"""Handles PONG messages."""
self.outstandingPing = False
def do376(self, msg):
self.got376 = True
def do433(self, msg):
"""Handles 'nickname already in use' messages."""
if not self._nickmods: