summaryrefslogtreecommitdiffstats
path: root/mbbsd
diff options
context:
space:
mode:
Diffstat (limited to 'mbbsd')
-rw-r--r--mbbsd/mbbsd.c6
-rw-r--r--mbbsd/telnet.c3
2 files changed, 8 insertions, 1 deletions
diff --git a/mbbsd/mbbsd.c b/mbbsd/mbbsd.c
index ff9188d8..6d86247b 100644
--- a/mbbsd/mbbsd.c
+++ b/mbbsd/mbbsd.c
@@ -1853,6 +1853,8 @@ tunnel_login(char *argv0, struct ProgramOption *option)
towrite(tunnel, &success, sizeof(success)) < sizeof(success))
return 0;
+ assert(dat.cb == sizeof(dat));
+
// optimize connection
set_connection_opt(csock);
@@ -1880,6 +1882,10 @@ tunnel_login(char *argv0, struct ProgramOption *option)
option->term_width = dat.t_cols;
option->term_height = dat.t_lines;
telnet_init(0);
+#ifdef DETECT_CLIENT
+ telnet_turnoff_client_detect();
+ client_code = dat.client_code; // use the client code detected by remote daemon
+#endif
return 1;
}
diff --git a/mbbsd/telnet.c b/mbbsd/telnet.c
index d60254ac..7cf1fee5 100644
--- a/mbbsd/telnet.c
+++ b/mbbsd/telnet.c
@@ -20,6 +20,7 @@ telnet_cb_resize_term(void *resize_arg, int w, int h)
}
const static struct TelnetCallback telnet_callback = {
+ NULL,
telnet_cb_resize_term,
#ifdef DETECT_CLIENT
telnet_cb_update_client_code,
@@ -39,7 +40,7 @@ telnet_init(int do_init_cmd)
telnet_ctx_set_cc_arg(ctx, (void*)1);
#endif
if (do_init_cmd)
- telnet_send_init_cmds(fd);
+ telnet_ctx_send_init_cmds(ctx);
}
/* tty_read