From 5def24d66561e13e76b7af3109810be21deeeffb Mon Sep 17 00:00:00 2001 From: minima Date: Tue, 8 Mar 2005 00:21:19 +0000 Subject: [PATCH] fix find --- perl/DXProt.pm | 2 +- perl/Thingy/Ping.pm | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) 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; -- 2.43.0