]> dxcluster.net Git - spider.git/commitdiff
fix DXChannel::get
authorwr3d <wr3d>
Sat, 12 Mar 2005 23:33:32 +0000 (23:33 +0000)
committerwr3d <wr3d>
Sat, 12 Mar 2005 23:33:32 +0000 (23:33 +0000)
Fix pinging (a bit)

perl/DXProt.pm
perl/Thingy/Ping.pm

index d8dad2c3280ad54b6716dedf6e57aa968515ba59..2bfd66865c6eac1e2e6808e2bab7e2c423b4ebc0 100644 (file)
@@ -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;
-                       }
+#                      }
                }
        }
 
index 0d005e48eccf923d67ddd8b7f1f5922a76fea5e7..ec9ce73d1b5b6b208abaea184b2fe3925aecd04c 100644 (file)
@@ -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});