mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 04:02:45 +01:00
classes.Irc: clear state on disconnect, not on connect
Possible fix for #183 - when networks disconnect, their server index wasn't cleared properly, causing errors from servers already existing to be thrown when the same server name is spawned again.
This commit is contained in:
parent
1930739aad
commit
2b16f25b61
@ -165,7 +165,6 @@ class Irc():
|
||||
__init__ in a separate thread to allow multiple concurrent connections.
|
||||
"""
|
||||
while True:
|
||||
self.initVars()
|
||||
ip = self.serverdata["ip"]
|
||||
port = self.serverdata["port"]
|
||||
checks_ok = True
|
||||
@ -299,6 +298,9 @@ class Irc():
|
||||
log.debug('(%s) _disconnect: Setting self.aborted to True.', self.name)
|
||||
self.aborted.set()
|
||||
|
||||
log.debug('(%s) disconnect: Clearing state via initVars().', self.name)
|
||||
self.initVars()
|
||||
|
||||
log.debug('(%s) Removing channel logging handlers due to disconnect.', self.name)
|
||||
while self.loghandlers:
|
||||
log.removeHandler(self.loghandlers.pop())
|
||||
|
Loading…
Reference in New Issue
Block a user