diff options
author | Mark Murray <markm@FreeBSD.org> | 1997-09-07 07:02:53 +0000 |
---|---|---|
committer | Mark Murray <markm@FreeBSD.org> | 1997-09-07 07:02:53 +0000 |
commit | 04c426cce3f772421256462aca04a85047d8ca76 (patch) | |
tree | abbd550c611dca52b6fea6b12fe44b08a6fd48c6 /contrib/telnet/telnetd/termstat.c | |
parent | c109c5775a0dc072fd79cf731b48f2a56356f7cc (diff) | |
download | src-04c426cce3f772421256462aca04a85047d8ca76.tar.gz src-04c426cce3f772421256462aca04a85047d8ca76.zip |
Bring the FreeBSD changes to the virgin sources.
Notes
Notes:
svn path=/head/; revision=29181
Diffstat (limited to 'contrib/telnet/telnetd/termstat.c')
-rw-r--r-- | contrib/telnet/telnetd/termstat.c | 53 |
1 files changed, 33 insertions, 20 deletions
diff --git a/contrib/telnet/telnetd/termstat.c b/contrib/telnet/telnetd/termstat.c index ebc843a13663..be1372a1491c 100644 --- a/contrib/telnet/telnetd/termstat.c +++ b/contrib/telnet/telnetd/termstat.c @@ -32,11 +32,15 @@ */ #ifndef lint -static char sccsid[] = "@(#)termstat.c 8.2 (Berkeley) 5/30/95"; +static const char sccsid[] = "@(#)termstat.c 8.2 (Berkeley) 5/30/95"; #endif /* not lint */ #include "telnetd.h" +#if defined(ENCRYPTION) +#include <libtelnet/encrypt.h> +#endif + /* * local variables */ @@ -144,8 +148,35 @@ localstat() #endif /* defined(CRAY2) && defined(UNICOS5) */ /* + * Check for changes to flow control if client supports it. + */ + flowstat(); + + /* + * Check linemode on/off state + */ + uselinemode = tty_linemode(); + + /* + * If alwayslinemode is on, and pty is changing to turn it off, then + * force linemode back on. + */ + if (alwayslinemode && linemode && !uselinemode) { + uselinemode = 1; + 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 don't support linemode, and doesn't gain us + * anything, we don't 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); @@ -161,24 +192,6 @@ localstat() if (my_want_state_is_will(TELOPT_BINARY)) send_wont(TELOPT_BINARY, 1); } - - /* - * Check for changes to flow control if client supports it. - */ - flowstat(); - - /* - * Check linemode on/off state - */ - uselinemode = tty_linemode(); - - /* - * If alwayslinemode is on, and pty is changing to turn it off, then - * force linemode back on. - */ - if (alwayslinemode && linemode && !uselinemode) { - uselinemode = 1; - tty_setlinemode(uselinemode); } #ifdef ENCRYPTION @@ -479,7 +492,7 @@ clientstat(code, parm1, parm2) ack = (useeditmode & MODE_ACK); useeditmode &= ~MODE_ACK; - if (changed = (useeditmode ^ editmode)) { + if ((changed = (useeditmode ^ editmode))) { /* * This check is for a timing problem. If the * state of the tty has changed (due to the user |