mirror of
https://github.com/evennia/evennia.git
synced 2026-03-23 08:16:30 +01:00
Fixed the telnet WILL/WONT ECHO (the echo protocol option) to work as expected from the server side - by telling the client that the server WON'T echo, we are implicitly telling the client that IT should then do the echoing. This is a bit unintuitive and was defined in the wrong order. Fixed now.
This commit is contained in:
parent
4a6cb039b6
commit
41ad2aed5d
1 changed files with 10 additions and 3 deletions
|
|
@ -328,11 +328,18 @@ class TelnetProtocol(Telnet, StatefulTelnetProtocol, Session):
|
|||
self.transport.write(mccp_compress(self, prompt))
|
||||
else:
|
||||
if echo is not None:
|
||||
# turn on/off echo
|
||||
# turn on/off echo. Note that this is a bit turned around since we use
|
||||
# echo as if we are "turning off the client's echo" when telnet really
|
||||
# handles it the other way around.
|
||||
if echo:
|
||||
self.transport.write(mccp_compress(self, IAC+WILL+ECHO))
|
||||
else:
|
||||
# by telling the client that WE WON'T echo, the client knows
|
||||
# that IT should echo. This is the expected behavior from
|
||||
# our perspective.
|
||||
self.transport.write(mccp_compress(self, IAC+WONT+ECHO))
|
||||
else:
|
||||
# by telling the client that WE WILL echo, the client can
|
||||
# safely turn OFF its OWN echo.
|
||||
self.transport.write(mccp_compress(self, IAC+WILL+ECHO))
|
||||
if raw:
|
||||
# no processing
|
||||
self.sendLine(text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue