3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

IRCNetwork: use \r\n as separator instead of \n

CRLF is the standard way of doing this per RFC1459
This commit is contained in:
James Lu 2017-07-07 20:07:20 -07:00
parent 51fb269d0d
commit 1172ca7387

View File

@ -1347,7 +1347,7 @@ class IRCNetwork(PyLinkNetworkCoreWithUtils):
# Safeguard against newlines in input!! Otherwise, each line gets
# treated as a separate command, which is particularly nasty.
data = data.replace('\n', ' ')
encoded_data = data.encode(self.encoding, 'replace')[:510] + b"\n"
encoded_data = data.encode(self.encoding, 'replace')[:510] + b"\r\n"
log.debug("(%s) -> %s", self.name, data)