1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Fix failure to re-enable local line discipline when TELOPT_ECHO is

turned _back off_ by the remote server. (server sends WONT)

[originally from svn r756]
This commit is contained in:
Simon Tatham 2000-10-24 11:16:25 +00:00
parent 384eeb3f76
commit 372a4e1e7e

View File

@ -166,6 +166,14 @@ static void deactivate_option (struct Opt *o) {
o->state = REALLY_INACTIVE; o->state = REALLY_INACTIVE;
} }
/*
* Generate side effects of enabling or disabling an option.
*/
static void option_side_effects(struct Opt *o, int enabled) {
if (o->option == TELOPT_ECHO && cfg.ldisc_term)
ldisc = enabled ? &ldisc_simple : &ldisc_term;
}
static void activate_option (struct Opt *o) { static void activate_option (struct Opt *o) {
if (o->send == WILL && o->option == TELOPT_NAWS) if (o->send == WILL && o->option == TELOPT_NAWS)
telnet_size(); telnet_size();
@ -178,8 +186,7 @@ static void activate_option (struct Opt *o) {
*/ */
deactivate_option (o->option==TELOPT_NEW_ENVIRON ? &o_oenv : &o_nenv); deactivate_option (o->option==TELOPT_NEW_ENVIRON ? &o_oenv : &o_nenv);
} }
if (o->option == TELOPT_ECHO && cfg.ldisc_term) option_side_effects(o, 1);
ldisc = &ldisc_simple;
} }
static void refused_option (struct Opt *o) { static void refused_option (struct Opt *o) {
@ -188,8 +195,7 @@ static void refused_option (struct Opt *o) {
send_opt (WILL, TELOPT_OLD_ENVIRON); send_opt (WILL, TELOPT_OLD_ENVIRON);
o_oenv.state = REQUESTED; o_oenv.state = REQUESTED;
} }
if (o->option == TELOPT_ECHO && cfg.ldisc_term) option_side_effects(o, 0);
ldisc = &ldisc_term;
} }
static void proc_rec_opt (int cmd, int option) { static void proc_rec_opt (int cmd, int option) {
@ -224,6 +230,7 @@ static void proc_rec_opt (int cmd, int option) {
case ACTIVE: case ACTIVE:
(*o)->state = INACTIVE; (*o)->state = INACTIVE;
send_opt ((*o)->nsend, option); send_opt ((*o)->nsend, option);
option_side_effects(*o, 0);
break; break;
case INACTIVE: case INACTIVE:
case REALLY_INACTIVE: case REALLY_INACTIVE: