do a better job with 'u=' and 'o-'
authorminima <minima>
Sat, 21 Jan 2006 17:54:04 +0000 (17:54 +0000)
committerminima <minima>
Sat, 21 Jan 2006 17:54:04 +0000 (17:54 +0000)
perl/DXXml/Ping.pm

index d70d6e9a46104cb379b95653af96862f4b0388b0..e02b61f85ca081a9fceb5fbf823c485d41621c2d 100644 (file)
@@ -97,7 +97,7 @@ sub handle_ping_reply
        my $tochan = DXChannel::get($from);
        while (@$ref) {
                my $r = shift @$ref;
-               my $dxchan = DXChannel::get($r->{u});
+               my $dxchan = DXChannel::get($r->{o});
                next unless $dxchan;
                my $t = tv_interval($r->{'-hirestime'}, [ gettimeofday ]);
                if ($dxchan->is_node) {
@@ -120,7 +120,8 @@ sub handle_ping_reply
                                $tochan->{nopings} = $nopings; # pump up the timer
                        }
                        _handle_believe($from, $fromdxchan->{call});
-               } elsif ($dxchan->is_user) {
+               } 
+               if (exists $r->{u} && ($dxchan = DXChannel::get($r->{u})) && $dxchan->is_user) {
                        my $s = sprintf "%.2f", $t; 
                        my $ave = sprintf "%.2f", $tochan ? ($tochan->{pingave} || $t) : $t;
                        $dxchan->send($dxchan->msg('pingi', $from, $s, $ave))