X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=perl%2FRoute.pm;h=769aefe8c01525e2d576540deb150432459bbbbd;hb=a48eea32af123b571889f70a3e7cef8e157cf389;hp=0f23d45531c1e40ba6aa9640931b232e01a338eb;hpb=be8bb8ddece08d2893896418423a95548cbf316f;p=spider.git diff --git a/perl/Route.pm b/perl/Route.pm index 0f23d455..769aefe8 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -181,6 +181,7 @@ sub config { my $self = shift; my $nodes_only = shift || 0; + my $width = shift || 79; my $level = shift; my $seen = shift; my @out; @@ -223,7 +224,7 @@ sub config } else { $c = "$ucall?"; } - if ((length $line) + (length $c) + 1 < 79) { + if ((length $line) + (length $c) + 1 < $width) { $line .= $c . ' '; } else { $line =~ s/\s+$//; @@ -251,7 +252,7 @@ sub config if ($nref) { my $c = $nref->user_call; dbg("recursing from $call -> $c") if isdbg('routec'); - my @rout = $nref->config($nodes_only, $level+1, $seen, @_); + my @rout = $nref->config($nodes_only, $width, $level+1, $seen, @_); if (@rout && @_) { push @out, ' ' x ($level*2) . $self->user_call unless grep /^\s+$call/, @out; } @@ -294,8 +295,12 @@ sub findroutes dbg("findroutes: $call level: $level calls: " . join(',', @_)) if isdbg('routec'); - # recursion detector + # recursion detector (no point in recursing that deeply) return () if $seen->{$call}; + if ($level >= 20) { + dbg("Route::findroutes: recursion limit reached looking for $call"); + return (); + } # return immediately if we are directly connected if (my $dxchan = DXChannel::get($call)) { @@ -312,7 +317,7 @@ sub findroutes unless ($seen->{$ncall}) { # put non-pc9x nodes to the back of the queue - my $l = $level + ($nref->{do_pc9x} ? 0 : 30); + 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;