PDP10, PDP11, VAX: Avoid corrupting a DMC/DMR unit attach string when a line state transitions

This commit is contained in:
Mark Pizzolato 2014-03-17 08:48:02 -07:00
parent 3b1b7d6aaf
commit 090b2f83f2
2 changed files with 11 additions and 9 deletions

View file

@ -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;

View file

@ -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)