]> dxcluster.net Git - spider.git/commitdiff
fix indirect routing to users 2 or more hops away
authorminima <minima>
Sun, 10 Jun 2001 12:26:35 +0000 (12:26 +0000)
committerminima <minima>
Sun, 10 Jun 2001 12:26:35 +0000 (12:26 +0000)
Changes
perl/Route.pm

diff --git a/Changes b/Changes
index 9b102bba06debe228e248b97df659efb3f70c4c3..0282bb591b3a7b64ade690b4921eca491ff51d67 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,6 @@
 10Jun01=======================================================================
 1. fix set/here and unset/here
+2. fix indirect routing to users two hops away
 09Jun01=======================================================================
 1. more fixes
 2. add set/debug filter so that you can see why your filters aren't working
index 521068b023cba2c2e1358140f549d667d8b1d0c9..d76cad19436e944e6ba815092d37f86a6069000f 100644 (file)
@@ -217,7 +217,7 @@ sub config
 
                if ($nref) {
                        my $c = $nref->user_call;
-                       dbg('routec', "recursing from $call -> $c");
+#                      dbg('routec', "recursing from $call -> $c");
                        push @out, $nref->config($nodes_only, $level+1, $seen, @_);
                } else {
                        push @out, ' ' x (($level+1)*2)  . "$ncall?" if @_ == 0 || (@_ && grep $ncall =~ m|$_|, @_); 
@@ -253,35 +253,40 @@ sub alldxchan
 {
        my $self = shift;
        my @dxchan;
+#      dbg('routech', "Trying node $self->{call}");
        my $dxchan = DXChannel->get($self->{call});
        push @dxchan, $dxchan if $dxchan;
        
        # it isn't, build up a list of dxchannels and possible ping times 
        # for all the candidates.
-       foreach my $p (@{$self->{parent}}) {
-               my $dxchan = DXChannel->get($p);
-               if ($dxchan) {
-                       push @dxchan, $dxchan unless grep $dxchan == $_, @dxchan;
-               } else {
+       unless (@dxchan) {
+               foreach my $p (@{$self->{parent}}) {
+#                      dbg('routech', "Trying parent $p");
                        next if $p eq $main::mycall; # the root
-                       my $ref = $self->get($p);
-                       push @dxchan, $ref->alldxchan if $ref;
+                       my $dxchan = DXChannel->get($p);
+                       if ($dxchan) {
+                               push @dxchan, $dxchan unless grep $dxchan == $_, @dxchan;
+                       } else {
+                               next if grep $p eq $_, @_;
+                               my $ref = Route::Node::get($p);
+#                              dbg('routech', "Next node $p " . ($ref ? 'Found' : 'NOT Found') );
+                               push @dxchan, $ref->alldxchan($self->{call}, @_) if $ref;
+                       }
                }
        }
+#      dbg('routech', "Got dxchan: " . join(',', (map{ $_->call } @dxchan)) );
        return @dxchan;
 }
 
 sub dxchan
 {
        my $self = shift;
-       my $dxchan = DXChannel->get($self->{call});
-       return $dxchan if $dxchan;
-       
        my @dxchan = $self->alldxchan;
        return undef unless @dxchan;
        
        # determine the minimum ping channel
        my $minping = 99999999;
+       my $dxchan;
        foreach my $dxc (@dxchan) {
                my $p = $dxc->pingave;
                if (defined $p  && $p < $minping) {