make ping reset the node obscount
authorDirk Koopman <djk@tobit.co.uk>
Mon, 24 Sep 2007 20:35:07 +0000 (21:35 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Mon, 24 Sep 2007 20:35:07 +0000 (21:35 +0100)
also add ping debugging on obscount tag

perl/DXProt.pm
perl/DXXml/Ping.pm
perl/Version.pm

index fdd3025a99bd290d19669c0a24adec5d438499f7..af7d73083a9e9f68d6947ea16450c7ed2d3fa1b5 100644 (file)
@@ -462,7 +462,6 @@ sub process
 
                foreach $dxchan (@dxchan) {
                        next unless $dxchan->is_node;
-                       next if $dxchan->handle_xml;
                        next if $dxchan == $main::me;
 
                        # send the pc50
@@ -471,12 +470,14 @@ sub process
                        # send a ping out on this channel
                        if ($dxchan->{pingint} && $t >= $dxchan->{pingint} + $dxchan->{lastping}) {
                                if ($dxchan->{nopings} <= 0) {
+                                       dbg("ROUTE: $dxchan->{call} disconnected on ping obscount") if isdbg('obscount');
                                        $dxchan->disconnect;
                                } else {
                                        DXXml::Ping::add($main::me, $dxchan->call);
                                        $dxchan->{nopings} -= 1;
                                        $dxchan->{lastping} = $t;
                                        $dxchan->{lastping} += $dxchan->{pingint} / 2 unless @{$dxchan->{pingtime}};
+                                       dbg("ROUTE: $dxchan->{call} ping obscount = $dxchan->{nopings}") if isdbg('obscount');
                                }
                        }
                }
@@ -1206,12 +1207,12 @@ sub addrcmd
 sub disconnect
 {
        my $self = shift;
-       my $pc39flag = shift;
+       my $pc39flag = shift || 0;
        my $call = $self->call;
 
        return if $self->{disconnecting}++;
 
-       unless ($pc39flag && $pc39flag == 1) {
+       unless ($pc39flag == 1) {
                $self->send_now("D", DXProt::pc39($main::mycall, $self->msg('disc1', "System Op")));
        }
 
@@ -1272,7 +1273,7 @@ sub disconnect
        }
 
        # broadcast to all other nodes that all the nodes connected to via me are gone
-       unless ($pc39flag && $pc39flag == 2)  {
+       unless ($pc39flag == 2)  {
                $self->route_pc21($main::mycall, undef, @rout) if @rout;
                $self->route_pc92d($main::mycall, undef, $main::routeroot, $node) if $node;
        }
index 04f830d1b534a8d701a32289a0b5d19c2db2ba29..29d7ab1c6a89ac7b1d99f92a7b627b6fcf82bed8 100644 (file)
@@ -14,6 +14,7 @@ use DXDebug;
 use DXProt;
 use IsoTime;
 use Time::HiRes qw(gettimeofday tv_interval);
+use Route::Node;
 
 use vars qw(@ISA %pings);
 @ISA = qw(DXXml);
@@ -115,6 +116,12 @@ sub handle_ping_reply
                                        $tochan->{pingave} = $tochan->{pingave} + (($t - $tochan->{pingave}) / 6);
                                }
                                $tochan->{nopings} = $nopings; # pump up the timer
+                               dbg("ROUTE: $tochan->{call} ping obscount reset to $tochan->{nopings}") if isdbg('obscount');
+                               my $nref = Route::Node::get($tochan->{call});
+                               if ($nref) {
+                                       my $n = $nref->reset_obs;
+                                       dbg("ROUTE: reset obscount on $tochan->{call} to $n (ping)") if isdbg('obscount');
+                               }
                        }
                        _handle_believe($from, $fromdxchan->{call});
                } 
index b8d30dd68257b2d18394ee9ea0e0cb958652b9a4..f42c8acf49677149826501d296dff821a31023ff 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '149';
+$build = '150';
 
 1;