From b71ca6af897af94adb03f961cb9257a51f213da8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz?= Date: Wed, 3 Jan 2018 15:18:28 +0100 Subject: [PATCH] IrcClient.py:IrcClient.{queue,unqueue}(): always CR NL-terminate messages & encode() before queuing. --- IrcClient.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/IrcClient.py b/IrcClient.py index 90b2629..161e1ca 100644 --- a/IrcClient.py +++ b/IrcClient.py @@ -95,13 +95,12 @@ class IrcClient: msg += ":" + args[argNum] else: msg += args[argNum] + " " - self.clientQueue.append(msg) + self.clientQueue.append((msg + "\r\n").encode()) # }}} # {{{ unqueue(): Send all queued lines to server, honouring timers def unqueue(self): while self.clientQueue: - msg = self.clientQueue[0] - msg = (msg + "\r\n").encode(); msgLen = len(msg); msgBytesSent = 0; + msg = self.clientQueue[0]; msgLen = len(msg); msgBytesSent = 0; while msgBytesSent < msgLen: if self.clientNextTimeout: timeNow = time.time()