From e1a6a997eb9423396159b8d90cd79b1bdbcb781c Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 2 Jun 2020 12:06:18 -0700 Subject: [PATCH] REMOTE_CONSOLE: Avoid rate limiting output to remote console sessions As discussed in #865 --- sim_console.c | 7 +++++++ sim_console.h | 1 + sim_tmxr.c | 3 ++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/sim_console.c b/sim_console.c index 284e41c9..7d3cb2c0 100644 --- a/sim_console.c +++ b/sim_console.c @@ -2007,6 +2007,13 @@ sprintf(cmdbuf, "BUFFERED=%d", bufsize); return tmxr_open_master (&sim_rem_con_tmxr, cmdbuf); /* open master socket */ } +t_bool sim_is_remote_console_master_line (void *lp) +{ +return sim_rem_master_mode && /* master mode */ + (((TMLN *)lp) >= sim_rem_con_tmxr.ldsc) && /* And it is one of the Remote Console Lines */ + (((TMLN *)lp) < sim_rem_con_tmxr.ldsc + sim_rem_con_tmxr.lines); +} + /* Enable or disable Remote Console master mode */ /* In master mode, commands are subsequently processed from the diff --git a/sim_console.h b/sim_console.h index 37a1fe06..ae0ab86a 100644 --- a/sim_console.h +++ b/sim_console.h @@ -126,6 +126,7 @@ int32 sim_tt_inpcvt (int32 c, uint32 mode); int32 sim_tt_outcvt (int32 c, uint32 mode); t_stat sim_tt_settabs (UNIT *uptr, int32 val, CONST char *cptr, void *desc); t_stat sim_tt_showtabs (FILE *st, UNIT *uptr, int32 val, CONST void *desc); +t_bool sim_is_remote_console_master_line (void *lp); extern int32 sim_rem_cmd_active_line; /* command in progress on line # */ diff --git a/sim_tmxr.c b/sim_tmxr.c index 49670e8c..353bc7bd 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -2205,7 +2205,8 @@ if ((lp->txbfd && !lp->notelnet) || (TXBUF_AVAIL(lp) > 1)) {/* room for char (+ sim_oline = save_oline; /* resture output socket */ } sim_exp_check (&lp->expect, chr); /* process expect rules as needed */ - if (!sim_is_running) { /* attach message or other non simulation time message? */ + if (!sim_is_running && /* attach message or other non simulation time message? */ + !sim_is_remote_console_master_line (lp)) { tmxr_send_buffered_data (lp); /* put data on wire */ sim_os_ms_sleep(((lp->txbps) && (lp->txdeltausecs > 1000)) ? /* rate limiting output slower than 1000 cps */ (lp->txdeltausecs - 1000) / 1000 :