Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/PuTTYNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2000-03-11 17:06:11 +0300
committerSimon Tatham <anakin@pobox.com>2000-03-11 17:06:11 +0300
commit3ee28098bcf32bcb3e563ff4aeb1a5079c274fb2 (patch)
tree6c080b03ab5f1045810b1265e050c51d15bf2f92 /telnet.c
parent4b3c825ec7739bb52685076e0dd00b3f2f9dafd1 (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.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/telnet.c b/telnet.c
index 24962bbd..7dd7f1ee 100644
--- a/telnet.c
+++ b/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;
}
}