]> dxcluster.org Git - spider.git/commitdiff
connect up the discontinuous trees and route better
authorDirk Koopman <djk@tobit.co.uk>
Sun, 24 Jun 2007 20:15:23 +0000 (21:15 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Sun, 24 Jun 2007 20:15:23 +0000 (21:15 +0100)
This involves making sure that all the external nodes get fixed
up even though their parent node does not yet exist (because no
config record has come in. It is safe to create these, in
anticipation of the C record coming in somewhen.

In the process of this, obscount reseting now happens much more
frequently (which I hope means correctly).

Allow Route::findroutes to find routes to these disconnected
nodes that are in the routing table but have no parent that is
yet anchored to a dxchan. Simply remember the dxchan that that
C record came in on. It doesn't matter if it gets overwritten by
another node, if it came in that way, there must be a route.

In any case, chances are, the first dxchan to get the C record
is the best and the deduping will (mostly) prevent it being
overwritten. When the linking C record comes in, it is all
irrelevant anyway...

Changes
perl/DXProtHandle.pm
perl/Route.pm
perl/Route/Node.pm
perl/Version.pm

diff --git a/Changes b/Changes
index 0dee640fe715c1599ff2bc40200bbd4897a1b421..ded4c90ee1004ef0c7a2e294fc5a823a634b0d7e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,7 @@
+24Jun06=======================================================================
+1. Fix the routing algorithms to allow route selection in the face of
+incomplete trees of nodes (trees as produced by sh/newc).
+2. Fix the obscout issues which mean that many nodes get timed out after 3hrs.
 23Jun06=======================================================================
 1. fix basic deduping algorithm
 2. rearrange node startup protocol to avoid issuing unnecessary PC92 and also
index 4a2be35765f854d815ae805a28847ac399d869ed..b83da41784b10ebb4f4d76bd13c25b34d30dfc3b 100644 (file)
@@ -1553,8 +1553,13 @@ sub handle_92
                                                # reparent to external node (note that we must have received a 'C' or 'A' record
                                                # from the true parent node for this external before we get one for the this node
                                                unless ($parent = Route::Node::get($call)) {
-                                                       dbg("PCPROT: no previous C or A for this external node received, ignored") if isdbg('chanerr');
-                                                       return;
+                                                       if ($is_extnode && $oparent) {
+                                                               @radd =  _add_thingy($oparent, $ent[0]);
+                                                               $parent = $radd[0];
+                                                       } else {
+                                                               dbg("PCPROT: no previous C or A for this external node received, ignored") if isdbg('chanerr');
+                                                               return;
+                                                       }
                                                }
                                                $parent = check_pc9x_t($call, $t, 92) || return;
                                                $parent->via_pc92(1);
@@ -1594,9 +1599,11 @@ sub handle_92
 
                        # we only reset obscounts on config records
                        $oparent->reset_obs;
+                       $oparent->PC92C_dxchan($self->{call}) unless $self->{call} eq $oparent->call;
                        dbg("ROUTE: reset obscount on $pcall now " . $oparent->obscount) if isdbg('obscount');
                        if ($oparent != $parent) {
                                $parent->reset_obs;
+                               $parent->PC92C_dxchan($self->{call}) unless $self->{call} eq $parent->call;
                                dbg("ROUTE: reset obscount on $parent->{call} now " . $parent->obscount) if isdbg('obscount');
                        }
 
index 415d1744f2f7ebcf263d55c9930797d27cf30303..51fceff5928a7b58b8232cb60043b8a904ce2f47 100644 (file)
@@ -200,7 +200,7 @@ sub config
                $pcall .= ":" . $self->obscount if isdbg('obscount');
 
 
-               $line = ' ' x ($level*2) . "$pcall";
+               $line = ' ' x ($level*2) . $pcall;
                $pcall = ' ' x length $pcall;
 
                # recursion detector
@@ -313,7 +313,34 @@ sub findroutes
                }
        }
 
-       return $level == 0 ? map {$_->[1]} sort {$a->[0] <=> $b->[0]} @out : @out;
+       if ($level == 0) {
+               my @nout = map {$_->[1]} sort {$a->[0] <=> $b->[0]} @out;
+               my $last;
+               if ($nref->isa('Route::Node')) {
+                       my $ncall = $nref->PC92C_dxchan;
+                       $last = DXChannel::get($ncall) if $ncall;
+               } else {
+                       my $pcall = $nref->{parent}->[0];
+                       my ($ref, $ncall);
+                       $ref = Route::Node::get($pcall) if $pcall;
+                       $ncall = $ref->PC92C_dxchan if $ref;
+                       $last = DXChannel::get($ncall) if $ncall;
+               }
+
+               if (isdbg('findroutes')) {
+                       if (@out) {
+                               foreach (sort {$a->[0] <=> $b->[0]} @out) {
+                                       dbg("ROUTE: findroute $call -> $_->[0] " . $_->[1]->call);
+                               }
+                       } else {
+                               dbg("ROUTE: findroute $call -> PC92C_dxchan " . $last->call) if $last;
+                       }
+               }
+               push @nout, $last if @out == 0 && $last;
+               return @nout;
+       } else {
+               return @out;
+       }
 }
 
 # find all the possible dxchannels which this object might be on
index a9bb2a44aa3f02deda232e301bc593ad6f43a2c3..3fa7a09750402ec49db1e5c7d3f28745478519cd 100644 (file)
@@ -32,6 +32,7 @@ use vars qw(%list %valid @ISA $max $filterdef $obscount);
                  via_pc92 => '0,Came in via pc92,yesno',
                  obscount => '0,Obscount',
                  last_PC92C => '9,Last PC92C',
+                 PC92C_dxchan => '9,Channel of PC92C',
 );
 
 $filterdef = $Route::filterdef;
index 04706cbe980c19ff06defa9b6d2dde88b002e6ea..703e9baf4762402fd5878093a3e7dd00d2e0a0a8 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '84';
+$build = '85';
 
 1;