3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

Make reconnecting a bit less... broken

This commit is contained in:
James Lu 2015-07-17 16:20:41 -07:00
parent fdea348cbe
commit bc9863d9e0
2 changed files with 2 additions and 2 deletions

View File

@ -107,7 +107,7 @@ class Irc():
log.debug('(%s) self.pingtimeout: %s', self.name, self.pingtimeout)
data = self.socket.recv(2048).decode("utf-8")
buf += data
if not data:
if self.connected and not data:
break
while '\n' in buf:
line, buf = buf.split('\n', 1)

View File

@ -19,7 +19,7 @@ def normalizeNick(irc, netname, nick, separator="/"):
# Block until we know the IRC network's nick length (after capabilities
# are sent)
log.debug('(%s) normalizeNick: waiting for irc.connected', irc.name)
irc.connected.wait(3)
irc.connected.wait(1)
orig_nick = nick
protoname = irc.proto.__name__