diff options
author | Simon Tatham <anakin@pobox.com> | 2000-03-11 17:06:11 +0300 |
---|---|---|
committer | Simon Tatham <anakin@pobox.com> | 2000-03-11 17:06:11 +0300 |
commit | 3ee28098bcf32bcb3e563ff4aeb1a5079c274fb2 (patch) | |
tree | 6c080b03ab5f1045810b1265e050c51d15bf2f92 /telnet.c | |
parent | 4b3c825ec7739bb52685076e0dd00b3f2f9dafd1 (diff) |
Robert de Bath's patch: integrate line disciplines into Telnet and have them
interoperate sensibly with ECHO negotiations
[originally from svn r401]
Diffstat (limited to 'telnet.c')
-rw-r--r-- | telnet.c | 26 |
1 files changed, 24 insertions, 2 deletions
@@ -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; } } |