3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +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:
James Lu 2016-03-25 14:59:07 -07:00
parent 1930739aad
commit 2b16f25b61

View File

@ -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())