Resolve merge conflicts

This commit is contained in:
Griatch 2018-01-29 00:16:30 +01:00
commit 0ae76233ee
5 changed files with 24 additions and 16 deletions

View file

@ -243,11 +243,15 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
line (str): Line to send.
"""
# escape IAC in line mode, and correctly add \r\n
line += self.delimiter
line = line.replace(IAC, IAC + IAC).replace('\n', '\r\n')
# escape IAC in line mode, and correctly add \r\n (the TELNET end-of-line)
line = line.replace(IAC, IAC + IAC)
line = line.replace('\n', '\r\n')
if not self.protocol_flags.get("NOGOAHEAD", True):
if self.protocol_flags.get("FORCEDENDLINE", False):
line += "\r\n"
line += IAC + GA
elif not line.endswith("\r\n"):
line += "\r\n"
return self.transport.write(mccp_compress(self, line))
# Session hooks