From: minima Date: Thu, 7 Jun 2001 11:43:11 +0000 (+0000) Subject: fix some little problems with disconnects X-Git-Tag: OLDROUTE_1_48~1 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=42032b193f4411c08979c2cd8d1f39818d5de235;p=spider.git fix some little problems with disconnects change behaviour of config --- diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 6fcf0289..0fce7f25 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1765,7 +1765,7 @@ sub disconnect # do routing stuff my $pref = Route::Node::get($self->{call}); - my @rout = $pref->del_nodes; + my @rout = $pref->del_nodes if $pref; push @rout, $main::routeroot->del_node($call); dbg('route', "B/C PC21 (from PC39) for: " . join(',', (map{ $_->call } @rout))) if @rout; diff --git a/perl/Route.pm b/perl/Route.pm index 47b87dac..cbc172dd 100644 --- a/perl/Route.pm +++ b/perl/Route.pm @@ -123,43 +123,50 @@ sub config my @out; my $line; my $call = $self->user_call; + my $printit = 1; - $line = ' ' x ($level*2) . "$call"; - $call = ' ' x length $call; - unless ($nodes_only) { - if (@{$self->{users}}) { - $line .= '->'; - foreach my $ucall (sort @{$self->{users}}) { - my $uref = Route::User::get($ucall); - my $c; - if ($uref) { - $c = $uref->user_call; - } else { - $c = "$ucall?"; - } - if ((length $line) + (length $c) + 1 < 79) { - $line .= $c . ' '; - } else { - $line =~ s/\s+$//; - push @out, $line; - $line = ' ' x ($level*2) . "$call->"; + # allow ranges + if (@_) { + $printit = grep $call =~ m|$_|, @_; + } + + if ($printit) { + $line = ' ' x ($level*2) . "$call"; + $call = ' ' x length $call; + unless ($nodes_only) { + if (@{$self->{users}}) { + $line .= '->'; + foreach my $ucall (sort @{$self->{users}}) { + my $uref = Route::User::get($ucall); + my $c; + if ($uref) { + $c = $uref->user_call; + } else { + $c = "$ucall?"; + } + if ((length $line) + (length $c) + 1 < 79) { + $line .= $c . ' '; + } else { + $line =~ s/\s+$//; + push @out, $line; + $line = ' ' x ($level*2) . "$call->"; + } } } } + $line =~ s/->$//g; + $line =~ s/\s+$//; + push @out, $line if length $line; } - $line =~ s/->$//g; - $line =~ s/\s+$//; - push @out, $line if length $line; foreach my $ncall (sort @{$self->{nodes}}) { my $nref = Route::Node::get($ncall); - next if @_ && !grep $ncall =~ m|$_|, @_; - + if ($nref) { my $c = $nref->user_call; push @out, $nref->config($nodes_only, $level+1, @_); } else { - push @out, ' ' x (($level+1)*2) . "$ncall?"; + push @out, ' ' x (($level+1)*2) . "$ncall?" if @_ == 0 || (@_ && grep $ncall =~ m|$_|, @_); } }