]> scm.dxcluster.org Git - spider.git/commitdiff
fixed problem where two consoles with same call stopped the cluster
authordjk <djk>
Sat, 10 Jul 1999 13:27:54 +0000 (13:27 +0000)
committerdjk <djk>
Sat, 10 Jul 1999 13:27:54 +0000 (13:27 +0000)
Changes
perl/DXMsg.pm
perl/cluster.pl

diff --git a/Changes b/Changes
index dfc59e34ce24360eb5572f8a7003b7d2ef7b2c85..88cb4b0f1a15a011ffc3b0b41a30fb847c55da44 100644 (file)
--- 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.
 05Jul99=======================================================================
 1. added stat/msg and stat/cluster commands to allow me to poke about inside
 the msg and cluster node tables.
index 2028f8b1da8403498950c746c2c3ab54c2408140..2abcb55f95b2967bf21f4d26d241c7f3c5530992 100644 (file)
@@ -135,6 +135,7 @@ sub process
                        my $node = $_;
                        my $ref = $busy{$_};
                        if (exists $ref->{lastt} && $main::systime > $ref->{lastt} + $timeout) {
                        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
                                $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};
                        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);
                        }
 
                                $ref->stop_msg($self->call);
                        }
 
@@ -198,6 +200,9 @@ sub process
                                        $ref->{count} = 0;
                                }
                                $ref->{lastt} = $main::systime;
                                        $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;
                }
                        }
                        last SWITCH;
                }
@@ -217,6 +222,7 @@ sub process
                                $ref->send_tranche($self);
                                $ref->{lastt} = $main::systime;
                        } else {
                                $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;
                                $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 {
                                $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;
                                $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 {
                                }
                                $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);
                                $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 {
                                }
                                $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
                        } 
 
                                $self->send(DXProt::pc42($f[2], $f[1], $f[3])); # unknown stream
                        } 
 
index 51e8aed7b386cd9ced159f7ac8d1408e9bb6c019..fdfff04f110abb24807561310a44543b76e96f24 100755 (executable)
@@ -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);
        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
 }
 
 # 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)) {
                 # 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;
                }
                        already_conn($conn, $call, $mess);
                        return;
                }