X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FRoute.pm;h=3c1c453e523a2a4088423576441b5730c771dade;hb=59e7157e3e342e629b1badcf1ba7d992b58a5caf;hp=794b8d3d71e15084a36d6854a81bf4129e33a49e;hpb=c8e15fc7003b239a21787cf79f22debdf3c419fd;p=spider.git diff --git a/perl/Route.pm b/perl/Route.pm index 794b8d3d..3c1c453e 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -295,7 +295,10 @@ sub findroutes # return immediately if we are directly connected my $dxchan = DXChannel::get($call); - return $dxchan if $dxchan; + if ($dxchan) { + dbg("ROUTE: findroutes $call -> directly connected") if isdbg('findroutes'); + return [99, $dxchan]; + } my $nref = Route::get($call); return () unless $nref; @@ -306,7 +309,10 @@ sub findroutes foreach my $p (@parent) { # return immediately if we are directly connected or a user's parent node is $dxchan = DXChannel::get($p); - return $dxchan if $dxchan; + if ($dxchan) { + dbg("ROUTE: findroutes $call -> connected direct via parent $p") if isdbg('findroutes'); + return [99, $dxchan]; + } my $r = Route::Node::get($p); if ($r) { @@ -325,10 +331,10 @@ sub findroutes } # get a sorted list of dxchannels with the highest hop count first - my @nout = map {$_->[1]} sort {$b->[0] <=> $a->[0]} @out; + my @nout = sort {$b->[0] <=> $a->[0]} @out; if (isdbg('findroutes')) { - if (@out) { - foreach (sort {$b->[0] <=> $a->[0]} @out) { + if (@nout) { + for (@nout) { dbg("ROUTE: findroutes $call -> $_->[0] " . $_->[1]->call); } } @@ -342,7 +348,7 @@ sub alldxchan { my $self = shift; my @dxchan = findroutes($self->{call}); - return @dxchan; + return map {$_->[1]} @dxchan; } sub dxchan