diff --git a/src/conf.py b/src/conf.py index 412e4b15d..eaecb1e8f 100644 --- a/src/conf.py +++ b/src/conf.py @@ -233,6 +233,13 @@ telnetPort = 31337 ### poll = 1 +### +# pingServer: Determines whether the bot will send PINGs to the server it's +# connected to in order to keep the connection alive. Sometimes +# this seems to result in instability. +### +pingServer = True + ### # maxHistory: Maximum number of messages kept in an Irc object's state. ### @@ -364,6 +371,7 @@ types = { 'detailedTracebacks': mybool, 'driverModule': mystr, 'showOnlySyntax': mybool, + 'pingServer': mybool, 'followIdentificationThroughNickChanges': mybool } diff --git a/src/irclib.py b/src/irclib.py index b8545ad9b..88280efc8 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -491,7 +491,8 @@ class Irc(IrcCommandDispatcher): else: self.lastTake = now msg = self.queue.dequeue() - elif now > (self.lastping + conf.pingInterval) and self.afterConnect: + elif conf.pingServer and \ + now > (self.lastping + conf.pingInterval) and self.afterConnect: if self.outstandingPing: s = 'Reconnecting to %s, ping not replied to.' % self.server log.warning(s)