Support clients using CR+NUL to signal EOL
authorJeremy Stanley <fungi@yuggoth.org>
Sun, 26 Aug 2018 17:42:15 +0000 (17:42 +0000)
committerJeremy Stanley <fungi@yuggoth.org>
Sun, 26 Aug 2018 19:22:15 +0000 (19:22 +0000)
commit7d270b507a1788a8d2b0a6f4747cf67ffdf81bee
treef7b37cc29d1ba48529b9fff9d12623089e344e40
parentf75bc473e2c6d7ef1954087261e1e139d200cfa4
Support clients using CR+NUL to signal EOL

IETF RFC 854 requires that a Telnet server accept CR+NUL
interchangeably with CR+LF to indicate end of an input line from any
NVT (client). CR+NUL also happens to be the default behavior of
popular Telnet clients specifically when communicating on TCP port
23 (as opposed to non-default ports where more liberal protocol
fallbacks get employed). Previously these clients would need to `set
crlf` in their .telnetrc or at a telnet> command prompt as a
workaround.

Alter the selftest framework to send \r\0 from the NVT as an EOL to
make sure this does not regress, and add a test to explicitly end a
command with a \r\n just to make sure we can continue to support
CR+LF from clients.
mudpy/misc.py
mudpy/telnet.py
mudpy/tests/selftest.py