X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FRoute.pm;h=0f23d45531c1e40ba6aa9640931b232e01a338eb;hb=be8bb8ddece08d2893896418423a95548cbf316f;hp=51fceff5928a7b58b8232cb60043b8a904ce2f47;hpb=ac14c6983861c08b8a2842af46e67407600f8065;p=spider.git diff --git a/perl/Route.pm b/perl/Route.pm index 51fceff5..0f23d455 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -296,6 +296,8 @@ sub findroutes # recursion detector return () if $seen->{$call}; + + # return immediately if we are directly connected if (my $dxchan = DXChannel::get($call)) { $seen->{$call}++; push @out, $level ? [$level, $dxchan] : $dxchan; @@ -305,10 +307,14 @@ sub findroutes # deal with more nodes my $nref = Route::get($call); + return () unless $nref; foreach my $ncall (@{$nref->{parent}}) { unless ($seen->{$ncall}) { - dbg("recursing from $call -> $ncall") if isdbg('routec'); - my @rout = findroutes($ncall, $level+1, $seen); + + # put non-pc9x nodes to the back of the queue + my $l = $level + ($nref->{do_pc9x} ? 0 : 30); + dbg("recursing from $call -> $ncall level $l") if isdbg('routec'); + my @rout = findroutes($ncall, $l+1, $seen); push @out, @rout; } }