Merge branch 'master' into develop

This commit is contained in:
Griatch 2018-01-29 20:26:59 +01:00
commit e413b1606a
2 changed files with 22 additions and 16 deletions

View file

@ -246,12 +246,10 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
# 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"):
if not line.endswith("\r\n") and self.protocol_flags.get("FORCEDENDLINE", True):
line += "\r\n"
if not self.protocol_flags.get("NOGOAHEAD", True):
line += IAC + GA
return self.transport.write(mccp_compress(self, line))
# Session hooks