From 30a49e1661047a23f128d9cf8ec4c3fc9b3797ac Mon Sep 17 00:00:00 2001 From: TheKysek Date: Wed, 17 Aug 2016 18:00:02 +0200 Subject: [PATCH] Do not go into infinite loop after closing connection --- src/connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/connection.py b/src/connection.py index 7b54905..ee9018d 100644 --- a/src/connection.py +++ b/src/connection.py @@ -69,7 +69,8 @@ class Connection(threading.Thread): data = self.s.recv(4096) self.buffer_receive += data logging.debug('Received {} bytes from {}:{}'.format(len(data), self.host, self.port)) - continue + if data: + continue else: data = self.s.recv(self.next_message_size - len(self.buffer_receive)) logging.debug('Received {} bytes from {}:{}'.format(len(data), self.host, self.port))