From: minima Date: Sun, 10 Jun 2001 12:26:35 +0000 (+0000) Subject: fix indirect routing to users 2 or more hops away X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=7694becd42a37ddbc1dfeb22f9667a167ea94dab;p=spider.git fix indirect routing to users 2 or more hops away --- diff --git a/Changes b/Changes index 9b102bba..0282bb59 100644 --- 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 diff --git a/perl/Route.pm b/perl/Route.pm index 521068b0..d76cad19 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -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) {