diff --git a/src/twistedDrivers.py b/src/twistedDrivers.py index f569fa977..2c5f589a0 100644 --- a/src/twistedDrivers.py +++ b/src/twistedDrivers.py @@ -41,7 +41,7 @@ import supybot.ircdb as ircdb import supybot.drivers as drivers import supybot.ircmsgs as ircmsgs -from twisted.internet import reactor +from twisted.internet import reactor, error from twisted.protocols.basic import LineReceiver from twisted.internet.protocol import ReconnectingClientFactory @@ -109,11 +109,13 @@ class SupyReconnectingFactory(ReconnectingClientFactory, drivers.ServersMixin): drivers.ServersMixin.__init__(self, irc) (server, port) = self._getNextServer() reactor.connectTCP(server, port, self) + ReconnectingClientFactory.__init__(self) def clientConnectionFailed(self, connector, r): drivers.log.connectError(self.currentServer, errorMsg(r)) (connector.host, connector.port) = self._getNextServer() - ReconnectingClientFactory.clientConnectionFailed(self, connector, r) + if not r.check(error.TimeoutError): + ReconnectingClientFactory.clientConnectionFailed(self, connector,r) def clientConnectionLost(self, connector, r): (connector.host, connector.port) = self._getNextServer() @@ -121,6 +123,7 @@ class SupyReconnectingFactory(ReconnectingClientFactory, drivers.ServersMixin): def startedConnecting(self, connector): drivers.log.connect(self.currentServer) + ReconnectingClientFactory.startedConnecting(self, connector) def buildProtocol(self, addr): protocol = ReconnectingClientFactory.buildProtocol(self, addr)