added code to prevent newlines being where they shouldn't be in outgoing lines.

This commit is contained in:
jesopo 2016-04-01 10:46:00 +01:00
parent 8843d9a469
commit 957947cf8d
No known key found for this signature in database
GPG key ID: 0BBDEB2AEFCFFCB3

View file

@ -154,7 +154,7 @@ class Server(object):
self.last_read = time.time() self.last_read = time.time()
return decoded_lines return decoded_lines
def send(self, data): def send(self, data):
encoded = data.encode("utf8") encoded = data.split("\n")[0].strip("\r").encode("utf8")
if len(encoded) > 450: if len(encoded) > 450:
encoded = encoded[:450] encoded = encoded[:450]
self.write_buffer += b"%s\r\n" % encoded self.write_buffer += b"%s\r\n" % encoded