Change GA style to not include endline, add FORCEDENDLINE for clients requiring GA+endline. See #1395.
This commit is contained in:
parent
9ed293b805
commit
587471c2b6
4 changed files with 24 additions and 12 deletions
|
|
@ -231,11 +231,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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue