From 4caf0d3cacae4ecb4995e7cedd725b953516792e Mon Sep 17 00:00:00 2001 From: djk Date: Sat, 10 Jul 1999 13:27:54 +0000 Subject: [PATCH] fixed problem where two consoles with same call stopped the cluster --- Changes | 5 +++++ perl/DXMsg.pm | 9 +++++++++ perl/cluster.pl | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index dfc59e34..88cb4b0f 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +10Jul99======================================================================= +1. added an explicit disconnect from my side for already connected calls. This +appears to have fixed a problem where if two consoles connect at the same time +with the same (sysop?) callsign the cluster would stop. +2. added some debugging in the Message handler to allow more state to be seen. 05Jul99======================================================================= 1. added stat/msg and stat/cluster commands to allow me to poke about inside the msg and cluster node tables. diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index 2028f8b1..2abcb55f 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -135,6 +135,7 @@ sub process my $node = $_; my $ref = $busy{$_}; if (exists $ref->{lastt} && $main::systime > $ref->{lastt} + $timeout) { + dbg('msg', "Timeout, stopping msgno: $ref->{msgno} -> $node"); $ref->stop_msg($node); # delay any outgoing messages that fail @@ -165,6 +166,7 @@ sub process if (exists $busy{$f[2]}) { my $ref = $busy{$f[2]}; my $tonode = $ref->{tonode}; + dbg('msg', "Busy, stopping msgno: $ref->{msgno} -> $f[2]"); $ref->stop_msg($self->call); } @@ -198,6 +200,9 @@ sub process $ref->{count} = 0; } $ref->{lastt} = $main::systime; + } else { + dbg('msg', "PC29 from unknown stream $f[3] from $f[2]" ); + $self->send(DXProt::pc42($f[2], $f[1], $f[3])); # unknown stream } last SWITCH; } @@ -217,6 +222,7 @@ sub process $ref->send_tranche($self); $ref->{lastt} = $main::systime; } else { + dbg('msg', "PC30 from unknown stream $f[3] from $f[2]" ); $self->send(DXProt::pc42($f[2], $f[1], $f[3])); # unknown stream } last SWITCH; @@ -229,6 +235,7 @@ sub process $ref->send_tranche($self); $ref->{lastt} = $main::systime; } else { + dbg('msg', "PC31 from unknown stream $f[3] from $f[2]" ); $self->send(DXProt::pc42($f[2], $f[1], $f[3])); # unknown stream } last SWITCH; @@ -281,6 +288,7 @@ sub process } $ref->stop_msg($self->call); } else { + dbg('msg', "PC32 from unknown stream $f[3] from $f[2]" ); $self->send(DXProt::pc42($f[2], $f[1], $f[3])); # unknown stream } # queue_msg(0); @@ -300,6 +308,7 @@ sub process } $ref->stop_msg($self->call); } else { + dbg('msg', "PC33 from unknown stream $f[3] from $f[2]" ); $self->send(DXProt::pc42($f[2], $f[1], $f[3])); # unknown stream } diff --git a/perl/cluster.pl b/perl/cluster.pl index 51e8aed7..fdfff04f 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -89,6 +89,8 @@ sub already_conn sleep(1); dbg('chan', "-> Z $call bye\n"); $conn->send_now("Z$call|bye"); # this will cause 'client' to disconnect + sleep(1); + $conn->disconnect; } # handle incoming messages @@ -109,7 +111,7 @@ sub rec # is there one already connected to me ? my $user = DXUser->get($call); if (DXChannel->get($call)) { - my $mess = DXM::msg($lang, $user->sort eq 'A' ? 'concluster' : 'conother', $call); + my $mess = DXM::msg($lang, $user->sort eq 'A' ? 'concluster' : 'conother', $call); already_conn($conn, $call, $mess); return; } -- 2.34.1