flowcontrol option to properly deal with the
RESTART_ANY and RESTART_XON suboptions.
SCCS-vsn: libexec/telnetd/telnetd.c 5.50
SCCS-vsn: libexec/telnetd/termstat.c 5.12
SCCS-vsn: libexec/telnetd/utility.c 5.10
SCCS-vsn: libexec/telnetd/state.c 5.12
SCCS-vsn: libexec/telnetd/sys_term.c 5.19
-static char sccsid[] = "@(#)state.c 5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)state.c 5.12 (Berkeley) %G%";
#endif /* not lint */
#include "telnetd.h"
#endif /* not lint */
#include "telnetd.h"
func = encrypt_send_support;
break;
#endif
func = encrypt_send_support;
break;
#endif
+ case TELOPT_LFLOW:
+ func = localstat;
+ break;
-static char sccsid[] = "@(#)sys_term.c 5.18 (Berkeley) %G%";
+static char sccsid[] = "@(#)sys_term.c 5.19 (Berkeley) %G%";
#endif /* not lint */
#include "telnetd.h"
#endif /* not lint */
#include "telnetd.h"
#ifndef USE_TERMIO
return(((termbuf.tc.t_startc) > 0 && (termbuf.tc.t_stopc) > 0) ? 1 : 0);
#else
#ifndef USE_TERMIO
return(((termbuf.tc.t_startc) > 0 && (termbuf.tc.t_stopc) > 0) ? 1 : 0);
#else
- return(termbuf.c_iflag & IXON ? 1 : 0);
+ return((termbuf.c_iflag & IXON) ? 1 : 0);
return(-1);
# endif
#else
return(-1);
# endif
#else
- return(termbuf.c_iflag & IXANY ? 1 : 0);
+ return((termbuf.c_iflag & IXANY) ? 1 : 0);
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)telnetd.c 5.49 (Berkeley) %G%";
+static char sccsid[] = "@(#)telnetd.c 5.50 (Berkeley) %G%";
#endif /* not lint */
#include "telnetd.h"
#endif /* not lint */
#include "telnetd.h"
*/
send_do(TELOPT_NAWS, 1);
send_will(TELOPT_STATUS, 1);
*/
send_do(TELOPT_NAWS, 1);
send_will(TELOPT_STATUS, 1);
- flowmode = 1; /* default flow control state */
+ flowmode = 1; /* default flow control state */
+ restartany = -1; /* uninitialized... */
send_do(TELOPT_LFLOW, 1);
/*
send_do(TELOPT_LFLOW, 1);
/*
if (his_state_is_will(TELOPT_LFLOW) &&
(ptyibuf[0] &
(TIOCPKT_NOSTOP|TIOCPKT_DOSTOP))) {
if (his_state_is_will(TELOPT_LFLOW) &&
(ptyibuf[0] &
(TIOCPKT_NOSTOP|TIOCPKT_DOSTOP))) {
- (void) sprintf(nfrontp, "%c%c%c%c%c%c",
- IAC, SB, TELOPT_LFLOW,
- ptyibuf[0] & TIOCPKT_DOSTOP ? 1 : 0,
- IAC, SE);
- nfrontp += 6;
+ int newflow =
+ ptyibuf[0] & TIOCPKT_DOSTOP ? 1 : 0;
+ if (newflow != flowmode) {
+ flowmode = newflow;
+ (void) sprintf(nfrontp,
+ "%c%c%c%c%c%c",
+ IAC, SB, TELOPT_LFLOW,
+ flowmode ? LFLOW_ON
+ : LFLOW_OFF,
+ IAC, SE);
+ nfrontp += 6;
+ }
}
pcc--;
ptyip = ptyibuf+1;
}
pcc--;
ptyip = ptyibuf+1;
-static char sccsid[] = "@(#)termstat.c 5.11 (Berkeley) %G%";
+static char sccsid[] = "@(#)termstat.c 5.12 (Berkeley) %G%";
#endif /* not lint */
#include "telnetd.h"
#endif /* not lint */
#include "telnetd.h"
if (his_state_is_will(TELOPT_LFLOW)) {
if (tty_flowmode() != flowmode) {
flowmode = tty_flowmode();
if (his_state_is_will(TELOPT_LFLOW)) {
if (tty_flowmode() != flowmode) {
flowmode = tty_flowmode();
- (void) sprintf(nfrontp, "%c%c%c%c%c%c", IAC, SB,
- TELOPT_LFLOW, flowmode ? LFLOW_ON : LFLOW_OFF,
- IAC, SE);
+ (void) sprintf(nfrontp, "%c%c%c%c%c%c",
+ IAC, SB, TELOPT_LFLOW,
+ flowmode ? LFLOW_ON : LFLOW_OFF,
+ IAC, SE);
+ }
+ if (tty_restartany() != restartany) {
restartany = tty_restartany();
restartany = tty_restartany();
- if (restartany >= 0) {
- (void) sprintf(nfrontp, "%c%c%c%c%c%c",
+ (void) sprintf(nfrontp, "%c%c%c%c%c%c",
IAC, SB, TELOPT_LFLOW,
restartany ? LFLOW_RESTART_ANY
: LFLOW_RESTART_XON,
IAC, SE);
IAC, SB, TELOPT_LFLOW,
restartany ? LFLOW_RESTART_ANY
: LFLOW_RESTART_XON,
IAC, SE);
-static char sccsid[] = "@(#)utility.c 5.9 (Berkeley) %G%";
+static char sccsid[] = "@(#)utility.c 5.10 (Berkeley) %G%";
#endif /* not lint */
#define PRINTOPTIONS
#endif /* not lint */
#define PRINTOPTIONS
break;
}
switch (pointer[1]) {
break;
}
switch (pointer[1]) {
sprintf(nfrontp, " OFF"); break;
sprintf(nfrontp, " OFF"); break;
sprintf(nfrontp, " ON"); break;
sprintf(nfrontp, " ON"); break;
+ case LFLOW_RESTART_ANY:
+ sprintf(nfrontp, " RESTART-ANY"); break;
+ case LFLOW_RESTART_XON:
+ sprintf(nfrontp, " RESTART-XON"); break;
default:
sprintf(nfrontp, " %d (unknown)", pointer[1]);
}
default:
sprintf(nfrontp, " %d (unknown)", pointer[1]);
}