]> dxcluster.org Git - spider.git/commitdiff
fix some little problems with disconnects
authorminima <minima>
Thu, 7 Jun 2001 11:43:11 +0000 (11:43 +0000)
committerminima <minima>
Thu, 7 Jun 2001 11:43:11 +0000 (11:43 +0000)
change behaviour of config

perl/DXProt.pm
perl/Route.pm

index 6fcf028924eb6007fd6befe6b8613f29b20c4646..0fce7f25704c67b98c3f939cf90ccd3e9bf455b8 100644 (file)
@@ -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;
        
index 47b87dac8a6fcfd8cf82af6f687a37f6036f566f..cbc172dd93350215e625cfe680a6ad3e77e88c49 100644 (file)
@@ -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|$_|, @_); 
                }
        }