Simplify telnet edefault encoding
This commit is contained in:
parent
8f5a28455e
commit
0acf0246c7
2 changed files with 4 additions and 10 deletions
|
|
@ -24,7 +24,6 @@ _RE_LEND = re.compile(r"\n$|\r$|\r\n$|\r\x00$|", re.MULTILINE)
|
|||
_RE_LINEBREAK = re.compile(r"\n\r|\r\n|\n|\r", re.DOTALL + re.MULTILINE)
|
||||
_RE_SCREENREADER_REGEX = re.compile(r"%s" % settings.SCREENREADER_REGEX_STRIP, re.DOTALL + re.MULTILINE)
|
||||
_IDLE_COMMAND = settings.IDLE_COMMAND + "\n"
|
||||
_TELNET_ENCODING = settings.ENCODINGS[0]
|
||||
|
||||
class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
||||
"""
|
||||
|
|
@ -49,8 +48,9 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
# this number is counted down for every handshake that completes.
|
||||
# when it reaches 0 the portal/server syncs their data
|
||||
self.handshakes = 8 # suppress-go-ahead, naws, ttype, mccp, mssp, msdp, gmcp, mxp
|
||||
self.init_session(self.protocol_name, client_address, self.factory.sessionhandler,
|
||||
override_flags={"ENCODING": _TELNET_ENCODING})
|
||||
self.init_session(self.protocol_name, client_address, self.factory.sessionhandler)
|
||||
# change encoding to ENCODINGS[0] which reflects Telnet default encoding
|
||||
self.protocol_flags["ENCODING"] = settings.ENCODINGS[0]
|
||||
|
||||
# suppress go-ahead
|
||||
self.sga = suppress_ga.SuppressGA(self)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue