From 090b2f83f287291ec71c1f7196249984f756b8f3 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 17 Mar 2014 08:48:02 -0700 Subject: [PATCH] PDP10, PDP11, VAX: Avoid corrupting a DMC/DMR unit attach string when a line state transitions --- PDP11/pdp11_dmc.c | 4 +++- sim_tmxr.c | 16 ++++++++-------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/PDP11/pdp11_dmc.c b/PDP11/pdp11_dmc.c index 4ded456d..653ed6b0 100644 --- a/PDP11/pdp11_dmc.c +++ b/PDP11/pdp11_dmc.c @@ -3574,7 +3574,9 @@ uint32 i, j; sim_debug(DBG_TRC, dptr, "dmc_reset(%s)\n", dptr->name); dmc_desc.packet = TRUE; +dmc_desc.buffered = 16384; dmp_desc.packet = TRUE; +dmp_desc.buffered = 16384; /* Connect structures together */ for (i=0; i < DMC_NUMDEVICE; i++) { dmc_csrs[i].sel0 = &dmc_sel0[i]; @@ -3738,7 +3740,7 @@ if (!peer[0]) { fprintf (sim_log, "Peer must be specified before attach\n"); return SCPE_ARG; } -sprintf (attach_string, "Line=%d,Buffered=16384,Connect=%s,%s", dmc, peer, cptr); +sprintf (attach_string, "Line=%d,Connect=%s,%s", dmc, peer, cptr); ans = tmxr_open_master (mp, attach_string); /* open master socket */ if (ans != SCPE_OK) return ans; diff --git a/sim_tmxr.c b/sim_tmxr.c index 4443c1c5..9f34f976 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -1238,13 +1238,6 @@ if ((lp->destination) && (!lp->serport)) { } } tmxr_init_line (lp); /* initialize line state */ -if (lp->mp->uptr) { - /* Revise the unit's connect string to reflect the current attachments */ - lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp); - /* No connections or listeners exist, then we're equivalent to being fully detached. We should reflect that */ - if (lp->mp->uptr->filename == NULL) - tmxr_detach (lp->mp, lp->mp->uptr); - } return SCPE_OK; } @@ -2014,7 +2007,7 @@ if (lp->sock) { /* if existing tcp, drop it */ if (close_connecting) { free (lp->destination); lp->destination = NULL; - if (lp->connecting) { /* if existing outgoing tcp, drop it */ + if (lp->connecting) { /* if existing outgoing tcp, drop it */ lp->sock = lp->connecting; lp->connecting = 0; tmxr_reset_ln (lp); @@ -2031,6 +2024,13 @@ if (lp->serport) { /* close current serial connection * lp->destination = NULL; } tmxr_set_line_loopback (lp, FALSE); +if ((lp->mp->uptr) && ((lp->uptr == NULL) || (lp->uptr == lp->mp->uptr))) { + /* Revise the unit's connect string to reflect the current attachments */ + lp->mp->uptr->filename = tmxr_mux_attach_string (lp->mp->uptr->filename, lp->mp); + /* No connections or listeners exist, then we're equivalent to being fully detached. We should reflect that */ + if (lp->mp->uptr->filename == NULL) + tmxr_detach (lp->mp, lp->mp->uptr); + } } t_stat tmxr_detach_ln (TMLN *lp)