mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Robert de Bath's patch: integrate line disciplines into Telnet and have them
interoperate sensibly with ECHO negotiations [originally from svn r401]
This commit is contained in:
parent
4b3c825ec7
commit
3ee28098bc
2
putty.h
2
putty.h
@ -79,7 +79,7 @@ GLOBAL char *logfile;
|
||||
|
||||
typedef enum {
|
||||
TS_AYT, TS_BRK, TS_SYNCH, TS_EC, TS_EL, TS_GA, TS_NOP, TS_ABORT,
|
||||
TS_AO, TS_IP, TS_SUSP, TS_EOR, TS_EOF
|
||||
TS_AO, TS_IP, TS_SUSP, TS_EOR, TS_EOF, TS_LECHO, TS_RECHO
|
||||
} Telnet_Special;
|
||||
|
||||
typedef enum {
|
||||
|
26
telnet.c
26
telnet.c
@ -216,6 +216,11 @@ static void activate_option (struct Opt *o) {
|
||||
*/
|
||||
deactivate_option (o->option==TELOPT_NEW_ENVIRON ? &o_oenv : &o_nenv);
|
||||
}
|
||||
if (o->option == TELOPT_ECHO)
|
||||
{
|
||||
cfg.ldisc_term = FALSE;
|
||||
ldisc = &ldisc_simple;
|
||||
}
|
||||
}
|
||||
|
||||
static void refused_option (struct Opt *o) {
|
||||
@ -224,6 +229,11 @@ static void refused_option (struct Opt *o) {
|
||||
send_opt (WILL, TELOPT_OLD_ENVIRON);
|
||||
o_oenv.state = REQUESTED;
|
||||
}
|
||||
if (o->option == TELOPT_ECHO)
|
||||
{
|
||||
cfg.ldisc_term = TRUE;
|
||||
ldisc = &ldisc_term;
|
||||
}
|
||||
}
|
||||
|
||||
static void proc_rec_opt (int cmd, int option) {
|
||||
@ -719,8 +729,20 @@ static void telnet_special (Telnet_Special code) {
|
||||
case TS_EOF: b[1] = xEOF; s_write (b, 2); break;
|
||||
case TS_SYNCH:
|
||||
outbuf_head = outbuf_reap = 0;
|
||||
b[0] = DM;
|
||||
send (s, b, 1, MSG_OOB);
|
||||
b[1] = DM;
|
||||
send (s, b, 2, MSG_OOB);
|
||||
break;
|
||||
case TS_RECHO:
|
||||
if (o_echo.state == INACTIVE || o_echo.state == REALLY_INACTIVE) {
|
||||
o_echo.state = REQUESTED;
|
||||
send_opt (o_echo.send, o_echo.option);
|
||||
}
|
||||
break;
|
||||
case TS_LECHO:
|
||||
if (o_echo.state == ACTIVE) {
|
||||
o_echo.state = REQUESTED;
|
||||
send_opt (o_echo.nsend, o_echo.option);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user