mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 19:52:54 +01:00
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:
parent
0045c5e69a
commit
0b6739b4bc
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user