3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 19:52:53 +01:00

Irc: fix the logic checking for data in run()

This commit is contained in:
James Lu 2015-08-10 20:26:19 -07:00
parent e756af42ee
commit 684eac9583

View File

@ -130,8 +130,8 @@ class Irc():
log.debug('(%s) self.pingtimeout: %s', self.name, self.pingtimeout)
data = self.socket.recv(2048)
buf += data
if self.connected and not data:
log.warn('(%s) No data received and self.connected is not set; disconnecting!', self.name)
if self.connected.is_set() and not data:
log.warn('(%s) No data received and self.connected is set; disconnecting!', self.name)
break
while b'\n' in buf:
line, buf = buf.split(b'\n', 1)