diff options
| author | David Greenman <dg@FreeBSD.org> | 1995-06-17 05:50:47 +0000 |
|---|---|---|
| committer | David Greenman <dg@FreeBSD.org> | 1995-06-17 05:50:47 +0000 |
| commit | ecf74fe675a16224aae550dcbcc402888df14681 (patch) | |
| tree | 5280aab064984dac3b5a35e4cb900cc8a49f1917 /libexec/telnetd | |
| parent | 0932a90b65e2fa786f9c0a11f223d8bd789fc087 (diff) | |
Notes
Diffstat (limited to 'libexec/telnetd')
| -rw-r--r-- | libexec/telnetd/termstat.c | 47 |
1 files changed, 28 insertions, 19 deletions
diff --git a/libexec/telnetd/termstat.c b/libexec/telnetd/termstat.c index 3fde25a50c3f..b08e50f0d625 100644 --- a/libexec/telnetd/termstat.c +++ b/libexec/telnetd/termstat.c @@ -144,25 +144,6 @@ localstat() #endif /* defined(CRAY2) && defined(UNICOS5) */ /* - * Check for state of BINARY options. - */ - if (tty_isbinaryin()) { - if (his_want_state_is_wont(TELOPT_BINARY)) - send_do(TELOPT_BINARY, 1); - } else { - if (his_want_state_is_will(TELOPT_BINARY)) - send_dont(TELOPT_BINARY, 1); - } - - if (tty_isbinaryout()) { - if (my_want_state_is_wont(TELOPT_BINARY)) - send_will(TELOPT_BINARY, 1); - } else { - if (my_want_state_is_will(TELOPT_BINARY)) - send_wont(TELOPT_BINARY, 1); - } - - /* * Check for changes to flow control if client supports it. */ flowstat(); @@ -181,6 +162,34 @@ localstat() tty_setlinemode(uselinemode); } + if (uselinemode) { + + /* + * Check for state of BINARY options. + * + * We only need to do the binary dance if we are actually going + * to use linemode. As this confuses some telnet clients that dont + * support linemode, and doesnt gain us anything, we dont do it + * unless we're doing linemode. -Crh (henrich@msu.edu) + */ + + if (tty_isbinaryin()) { + if (his_want_state_is_wont(TELOPT_BINARY)) + send_do(TELOPT_BINARY, 1); + } else { + if (his_want_state_is_will(TELOPT_BINARY)) + send_dont(TELOPT_BINARY, 1); + } + + if (tty_isbinaryout()) { + if (my_want_state_is_wont(TELOPT_BINARY)) + send_will(TELOPT_BINARY, 1); + } else { + if (my_want_state_is_will(TELOPT_BINARY)) + send_wont(TELOPT_BINARY, 1); + } + + } /* * Do echo mode handling as soon as we know what the |
