mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-28 05:29:25 +01:00
Make reconnecting a bit less... broken
This commit is contained in:
parent
fdea348cbe
commit
bc9863d9e0
2
main.py
2
main.py
@ -107,7 +107,7 @@ class Irc():
|
|||||||
log.debug('(%s) self.pingtimeout: %s', self.name, self.pingtimeout)
|
log.debug('(%s) self.pingtimeout: %s', self.name, self.pingtimeout)
|
||||||
data = self.socket.recv(2048).decode("utf-8")
|
data = self.socket.recv(2048).decode("utf-8")
|
||||||
buf += data
|
buf += data
|
||||||
if not data:
|
if self.connected and not data:
|
||||||
break
|
break
|
||||||
while '\n' in buf:
|
while '\n' in buf:
|
||||||
line, buf = buf.split('\n', 1)
|
line, buf = buf.split('\n', 1)
|
||||||
|
@ -19,7 +19,7 @@ def normalizeNick(irc, netname, nick, separator="/"):
|
|||||||
# Block until we know the IRC network's nick length (after capabilities
|
# Block until we know the IRC network's nick length (after capabilities
|
||||||
# are sent)
|
# are sent)
|
||||||
log.debug('(%s) normalizeNick: waiting for irc.connected', irc.name)
|
log.debug('(%s) normalizeNick: waiting for irc.connected', irc.name)
|
||||||
irc.connected.wait(3)
|
irc.connected.wait(1)
|
||||||
|
|
||||||
orig_nick = nick
|
orig_nick = nick
|
||||||
protoname = irc.proto.__name__
|
protoname = irc.proto.__name__
|
||||||
|
Loading…
Reference in New Issue
Block a user