X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2FRoute.pm;h=abc098471e7edaf0e7a721887a778359a77b3571;hb=0cbfabaee9288f28566fc2b3ac18d97841ea061d;hp=290cd7628f10823e61611398bf48a8b95de9ba2c;hpb=fb9c2ab04977b4e685b0eca3b2a2d04a77f65f4b;p=spider.git diff --git a/perl/Route.pm b/perl/Route.pm index 290cd762..abc09847 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; @@ -308,8 +310,11 @@ sub findroutes 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} && ($nref->{version}||5454) >= 5454 ? 0 : 30); + dbg("recursing from $call -> $ncall level $l") if isdbg('routec'); + my @rout = findroutes($ncall, $l+1, $seen); push @out, @rout; } }