From: minima Date: Mon, 9 Apr 2001 21:07:08 +0000 (+0000) Subject: fix nasty timer bug X-Git-Tag: R_1_47~42 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=a6e52cc1680c2c30ef874e2e6c16d00c956624ee;p=spider.git fix nasty timer bug --- diff --git a/Changes b/Changes index c8428e0b..4cb272e4 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ 10Apr01======================================================================= 1. altered PC21 logic somewhat to eliminate dup PC21s 2. disconnect should remove dangling local users in the routing table. +3. fixed nasty recursive timer bug 09Apr01======================================================================= 1. changed lockfile name to cluster.lck (from .lock) for MSWin's benefit 08Apr01======================================================================= diff --git a/cmd/disconnect.pl b/cmd/disconnect.pl index 00a462a7..9acf0ce3 100644 --- a/cmd/disconnect.pl +++ b/cmd/disconnect.pl @@ -26,9 +26,9 @@ foreach $call (@calls) { } elsif (my $conn = Msg->conns($call)) { $conn->disconnect; push @out, $self->msg('disc3', $call); - } elsif (my $ref = DXCLuster->get_exact($call)) { - my $dxchan = $ref->dxchan; - if ($dxchan && $dxchan->call eq $main::mycall) { + } 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); } diff --git a/perl/ExtMsg.pm b/perl/ExtMsg.pm index 4475f6a1..cc938bd8 100644 --- a/perl/ExtMsg.pm +++ b/perl/ExtMsg.pm @@ -335,8 +335,6 @@ sub _timedout { my $conn = shift; dbg('connect', "timed out after $conn->{timeval} seconds"); - $conn->{timeout}->del; - delete $conn->{timeout}; $conn->disconnect; } diff --git a/perl/Timer.pm b/perl/Timer.pm index 0c44278e..281421f0 100644 --- a/perl/Timer.pm +++ b/perl/Timer.pm @@ -41,17 +41,18 @@ sub handler my $now = time; # handle things on the timer chain - for (@timerchain) { - if ($now >= $_->{t}) { - &{$_->{proc}}(); - $_->{t} = $now + $_->{interval} if exists $_->{interval}; + my $t; + foreach $t (@timerchain) { + if ($now >= $t->{t}) { + &{$t->{proc}}(); + $t->{t} = $now + $t->{interval} if exists $t->{interval}; } } } sub DESTROY { - dbg('connll', "Timer destroyed ($notimers)"); - $notimers--; + dbg('connll', "timer destroyed ($Timer::notimers)"); + $Timer::notimers--; } 1; diff --git a/perl/cluster.pl b/perl/cluster.pl index 8a02bfd3..6ac7a3fb 100755 --- a/perl/cluster.pl +++ b/perl/cluster.pl @@ -100,7 +100,7 @@ sub already_conn dbg('chan', "-> D $call $mess\n"); $conn->send_now("D$call|$mess"); - Msg->sleep(2); + sleep(2); $conn->disconnect; }