3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +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) log.debug('(%s) self.pingtimeout: %s', self.name, self.pingtimeout)
data = self.socket.recv(2048) data = self.socket.recv(2048)
buf += data buf += data
if self.connected and not data: if self.connected.is_set() and not data:
log.warn('(%s) No data received and self.connected is not set; disconnecting!', self.name) log.warn('(%s) No data received and self.connected is set; disconnecting!', self.name)
break break
while b'\n' in buf: while b'\n' in buf:
line, buf = buf.split(b'\n', 1) line, buf = buf.split(b'\n', 1)