From a55714f18999ec1ac500dfcbf7f3f12cc4a96f99 Mon Sep 17 00:00:00 2001 From: wr3d Date: Sat, 12 Mar 2005 23:33:32 +0000 Subject: [PATCH] fix DXChannel::get Fix pinging (a bit) --- perl/DXProt.pm | 14 ++++++++++---- perl/Thingy/Ping.pm | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/perl/DXProt.pm b/perl/DXProt.pm index d8dad2c3..2bfd6686 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -972,6 +972,12 @@ sub handle_19 } else { next; } + } else { + if ($r->version != $ver || $r->flags != $flags) { + $r->version($ver); + $r->flags($flags); + push @rout, $r; + } } } else { @@ -1572,13 +1578,13 @@ sub process # send a ping out on this channel if ($dxchan->{pingint} && $t >= $dxchan->{pingint} + $dxchan->{lastping}) { - if ($dxchan->{nopings} <= 0) { - $dxchan->disconnect; - } else { +# if ($dxchan->{nopings} <= 0) { +# $dxchan->disconnect; +# } else { addping($main::mycall, $dxchan->call); $dxchan->{nopings} -= 1; $dxchan->{lastping} = $t; - } +# } } } diff --git a/perl/Thingy/Ping.pm b/perl/Thingy/Ping.pm index 0d005e48..ec9ce73d 100644 --- a/perl/Thingy/Ping.pm +++ b/perl/Thingy/Ping.pm @@ -118,7 +118,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 ||= find(($thing->{user}||$thing->{origin}), ($thing->{touser}||$thing->{group})); + $ref = find(($thing->{user}||$thing->{origin}), ($thing->{touser}||$thing->{group})) unless $ref; if ($ref) { my $t = tv_interval($ref->{t}, [ gettimeofday ]); my $tochan = DXChannel::get($ref->{touser} || $ref->{group}); -- 2.43.0