fix nasty timer bug
[spider.git] / cmd / disconnect.pl
index 195cdf8c2ae043b9efdf7cb9391a8dc634d5b113..9acf0ce336fa5f37d5621b80139803097187c67b 100644 (file)
@@ -23,12 +23,15 @@ foreach $call (@calls) {
                } 
                $dxchan->disconnect;
                push @out, $self->msg('disc2', $call);
-       } elsif (my $out = grep {$_->{call} eq $call} @main::outstanding_connects) {
-               unless ($^O =~ /^MS/i) {
-                       kill 'TERM', $out->{pid};
+       } elsif (my $conn = Msg->conns($call)) {
+               $conn->disconnect;
+               push @out, $self->msg('disc3', $call);
+       } elsif (my $ref = DXCluster->get_exact($call)) {
+               my $dxchancall = $ref->dxchancall;
+               if ($dxchancall eq $main::mycall || !DXChannel->get($dxchancall)) {
+                       $ref->del;
+                       push @out, $self->msg('disc4', $call);
                }
-               @main::outstanding_connects = grep {$_->{call} ne $call} @main::outstanding_connects;
-               push @out, $self->msg('disc2', $call);
        } else {
                push @out, $self->msg('e10', $call);
        }