send only pc39 and no pc21s when shuttinng down
authorminima <minima>
Tue, 10 Apr 2001 10:06:50 +0000 (10:06 +0000)
committerminima <minima>
Tue, 10 Apr 2001 10:06:50 +0000 (10:06 +0000)
Changes
perl/DXProt.pm
perl/cluster.pl

diff --git a/Changes b/Changes
index 9452892f8867614b9fbfee2884ded2fbfeee2c1e..945bf383afef7039a3ebe38814dadd12f56fc2b2 100644 (file)
--- a/Changes
+++ b/Changes
@@ -2,6 +2,9 @@
 1. fixed more of the "xxx disappeared from yyy" messages
 2. altered the build no logic so that it always checksums the same files
 regardless of whatever else you might have in the directory.
+3. made shortcut at shutdown so that you don't get a storm of PC21s on busy
+nodes as each connection goes down. Just send a pc39 to each interface and
+nothing else.
 10Apr01=======================================================================
 1. altered PC21 logic somewhat to eliminate dup PC21s
 2. disconnect should remove dangling local users in the routing table.
index 8687a4943d446c920152a73b9657ae7a0ce5c1fc..e92ca8a1acbada27e04fac33e8e3c64dd105d24b 100644 (file)
@@ -1688,10 +1688,10 @@ sub addrcmd
 sub disconnect
 {
        my $self = shift;
-       my $nopc39 = shift;
+       my $pc39flag = shift;
        my $call = $self->call;
 
-       unless ($nopc39) {
+       unless ($pc39flag && $pc39flag == 1) {
                $self->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', "System Op")));
        }
 
@@ -1709,10 +1709,12 @@ sub disconnect
        }
 
        # broadcast to all other nodes that all the nodes connected to via me are gone
-       unless ($self->{isolate}) {
-               push @nodes, $call;
-               for (@nodes) {
-                       broadcast_ak1a(pc21($_, 'Gone.'), $self);
+       unless ($pc39flag && $pc39flag == 2) {
+               unless ($self->{isolate}) {
+                       push @nodes, $call;
+                       for (@nodes) {
+                               broadcast_ak1a(pc21($_, 'Gone.'), $self);
+                       }
                }
        }
 
index 3bed469c69085a786766ddc96008769ce3a39151..20e80ddbfe16f61978b8f5731431a94c2e19375f 100755 (executable)
@@ -227,7 +227,7 @@ sub cease
        # disconnect users
        foreach $dxchan (DXChannel->get_all()) {
                next if $dxchan->is_node;
-               $dxchan->disconnect unless $dxchan == $DXProt::me;
+               $dxchan->disconnect(2) unless $dxchan == $DXProt::me;
        }
 
        # disconnect AGW
@@ -246,8 +246,8 @@ sub cease
        DXDb::closeall;
 
        # close all listeners
-       for (@listeners) {
-               $_->close_server;
+       foreach my $l (@listeners) {
+               $l->close_server;
        }
 
        dbg('chan', "DXSpider version $version, build $build ended");
@@ -381,11 +381,11 @@ my $conn = IntMsg->new_server($clusteraddr, $clusterport, \&login);
 $conn->conns("Server $clusteraddr/$clusterport");
 push @listeners, $conn;
 dbg('err', "Internal port: $clusteraddr $clusterport");
-for (@main::listen) {
-       $conn = ExtMsg->new_server($_->[0], $_->[1], \&login);
-       $conn->conns("Server $_->[0]/$_->[1]");
+foreach my $l (@main::listen) {
+       $conn = ExtMsg->new_server($l->[0], $l->[1], \&login);
+       $conn->conns("Server $l->[0]/$l->[1]");
        push @listeners, $conn;
-       dbg('err', "External Port: $_->[0] $_->[1]");
+       dbg('err', "External Port: $l->[0] $l->[1]");
 }
 AGWrestart();