Man, tracking these things down can be somewhat tough sometimes. They'll fix this in Twisted, but for now, we need a workaround.

This commit is contained in:
Jeremy Fincher 2004-09-17 23:52:37 +00:00
parent 0045c5e69a
commit 0b6739b4bc

View File

@ -41,7 +41,7 @@ import supybot.ircdb as ircdb
import supybot.drivers as drivers import supybot.drivers as drivers
import supybot.ircmsgs as ircmsgs import supybot.ircmsgs as ircmsgs
from twisted.internet import reactor from twisted.internet import reactor, error
from twisted.protocols.basic import LineReceiver from twisted.protocols.basic import LineReceiver
from twisted.internet.protocol import ReconnectingClientFactory from twisted.internet.protocol import ReconnectingClientFactory
@ -109,11 +109,13 @@ class SupyReconnectingFactory(ReconnectingClientFactory, drivers.ServersMixin):
drivers.ServersMixin.__init__(self, irc) drivers.ServersMixin.__init__(self, irc)
(server, port) = self._getNextServer() (server, port) = self._getNextServer()
reactor.connectTCP(server, port, self) reactor.connectTCP(server, port, self)
ReconnectingClientFactory.__init__(self)
def clientConnectionFailed(self, connector, r): def clientConnectionFailed(self, connector, r):
drivers.log.connectError(self.currentServer, errorMsg(r)) drivers.log.connectError(self.currentServer, errorMsg(r))
(connector.host, connector.port) = self._getNextServer() (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): def clientConnectionLost(self, connector, r):
(connector.host, connector.port) = self._getNextServer() (connector.host, connector.port) = self._getNextServer()
@ -121,6 +123,7 @@ class SupyReconnectingFactory(ReconnectingClientFactory, drivers.ServersMixin):
def startedConnecting(self, connector): def startedConnecting(self, connector):
drivers.log.connect(self.currentServer) drivers.log.connect(self.currentServer)
ReconnectingClientFactory.startedConnecting(self, connector)
def buildProtocol(self, addr): def buildProtocol(self, addr):
protocol = ReconnectingClientFactory.buildProtocol(self, addr) protocol = ReconnectingClientFactory.buildProtocol(self, addr)