set ^Z and ^V correctly
[spider.git] / perl / DXCluster.pm
index a741e5f2c4805742d6d18b1be780f09fc4b99aad..aee8fe4d94a0c6a0e1c192fb1d94d836b705edd1 100644 (file)
@@ -136,12 +136,6 @@ sub cluster
        return " $DXNode::nodes nodes, $users local / $tot total users  Max users $DXNode::maxusers  Uptime $uptime";
 }
 
-sub DESTROY
-{
-       my $self = shift;
-       dbg('cluster', "destroying $self->{call}\n");
-}
-
 no strict;
 sub AUTOLOAD
 {
@@ -251,7 +245,10 @@ sub del
        }
        delete $DXCluster::cluster{$call}; # remove me from the cluster table
        dbg('cluster', "deleting node $call from cluster\n"); 
-       $nodes-- if $nodes > 0;
+       $users -= $self->{users};    # it may be PC50 updated only therefore > 0
+       $users = 0 if $users < 0;
+       $nodes--;
+       $nodes = 0 if $nodes < 0;
 }
 
 sub add_user
@@ -300,5 +297,13 @@ sub dolist
 {
 
 }
+
+sub DESTROY
+{
+       my $self = shift;
+       undef $self->{list} if $self->{list};
+}
+
+
 1;
 __END__