From: minima Date: Tue, 8 Mar 2005 00:21:19 +0000 (+0000) Subject: fix find X-Git-Tag: R_1_52~115 X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=5def24d66561e13e76b7af3109810be21deeeffb;p=spider.git fix find --- diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 78c39f16..7972bc3b 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1541,7 +1541,7 @@ sub handle_51 my $line = shift; my $origin = shift; - if (eph_dup($line)) { + if (eph_dup($line, 60)) { dbg("PCPROT: dup PC51 detected") if isdbg('chanerr'); return; } diff --git a/perl/Thingy/Ping.pm b/perl/Thingy/Ping.pm index 39a4ee78..30359a42 100644 --- a/perl/Thingy/Ping.pm +++ b/perl/Thingy/Ping.pm @@ -99,7 +99,7 @@ sub handle # it's a reply, look in the ping list for this one my $ref = $ping{$thing->{id}} if exists $thing->{id}; - $ref ||= $thing->find; + $ref ||= find($thing->{origin}, $thing->{group}); if ($ref) { my $t = tv_interval($ref->{t}, [ gettimeofday ]); if (my $dxc = DXChannel::get($ref->{user} || $ref->{origin})) { @@ -179,10 +179,17 @@ sub forget sub find { - my $call = shift; + my $to = shift; + my $from = shift; + my $user = shift; + foreach my $thing (values %ping) { - if (($thing->{user} || $thing->{origin}) eq $call) { - return $thing; + if ($thing->{origin} eq $from && $thing->{group} eq $to) { + if ($user) { + return if $thing->{user} && $thing->{user} eq $user; + } else { + return $thing; + } } } return undef;