From 6cabdb9f9f0ae781516f85e6909876faff470d6f Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 15 Dec 2012 11:40:20 -0800 Subject: [PATCH] Fixed duplicate logging output when output buffers are full and potential pauses in console output (reported by Mark Benson) --- sim_console.c | 3 +-- sim_tmxr.c | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/sim_console.c b/sim_console.c index 40813bab..edce24d6 100644 --- a/sim_console.c +++ b/sim_console.c @@ -185,8 +185,7 @@ if (sim_con_tmxr.master == 0) /* not Telnet? done */ if (tmxr_poll_conn (&sim_con_tmxr) >= 0) /* poll connect */ sim_con_ldsc.rcve = 1; /* rcv enabled */ sim_activate_after(uptr, 1000000); /* check again in 1 second */ -if (sim_con_ldsc.xmte == 0) /* xmt disabled? */ - tmxr_send_buffered_data (&sim_con_ldsc); /* try to flush buffered data */ +tmxr_send_buffered_data (&sim_con_ldsc); /* try to flush any buffered data */ return SCPE_OK; } diff --git a/sim_tmxr.c b/sim_tmxr.c index 70041bc2..4b5f8c69 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -1272,8 +1272,6 @@ if ((lp->conn == 0) && /* no conn & not buffere ++lp->txdrp; /* lost */ return SCPE_LOST; } -if (lp->txlog) /* log if available */ - fputc (chr, lp->txlog); tmxr_debug_trace_line (lp, "tmxr_putc_ln()"); #define TXBUF_AVAIL(lp) (lp->txbsz - tmxr_tqln (lp)) #define TXBUF_CHAR(lp, c) { \ @@ -1288,6 +1286,8 @@ if ((lp->txbfd) || (TXBUF_AVAIL(lp) > 1)) { /* room for char (+ IAC) TXBUF_CHAR (lp, chr); /* buffer char & adv pointer */ if ((!lp->txbfd) && (TXBUF_AVAIL (lp) <= TMXR_GUARD))/* near full? */ lp->xmte = 0; /* disable line */ + if (lp->txlog) /* log if available */ + fputc (chr, lp->txlog); return SCPE_OK; /* char sent */ } ++lp->txdrp; lp->xmte = 0; /* no room, dsbl line */