]> dxcluster.org Git - spider.git/commitdiff
and a bit more
authorminima <minima>
Tue, 6 Jul 2004 21:52:48 +0000 (21:52 +0000)
committerminima <minima>
Tue, 6 Jul 2004 21:52:48 +0000 (21:52 +0000)
perl/DXProt.pm
perl/Route/Node.pm

index 51bdc8efa34712dcdc6b05743f193dbfe516c178..497a26712b63f64b279b7bde6992f4d4fc2d525b 100644 (file)
@@ -842,9 +842,16 @@ sub handle_18
        $self->newroute( $_[1] =~ /NewRoute/ );
 
        # first clear out any nodes on this dxchannel
-       my $parent = Route::Node::get($self->{call});
-       my @rout = $parent->del_nodes;
-       $self->route_pc21($origin, $line, @rout, $parent) if @rout;
+       my $node = Route::Node::get($self->{call}) ;
+       my @rout = grep {$_ != $node } $main::routeroot->remove_route($node, $self) if $node;
+       my @rusers;
+       push @rusers, $_->unlink_all_users for @rout;
+       $self->route_pc21($origin, $line, @rout) if @rout;
+       for (@rout, @rusers) {
+               $_->delete;
+       };
+       
+       # send the new config
        $self->send_local_config();
        $self->send(pc20());
 }
index 6f8de6dee1ca0431d37ef25c757877fc67e3a797..3c0feb4ba32f527fedd97b7321fbb13757fe6840 100644 (file)
@@ -183,7 +183,7 @@ sub unlink_all_users
 {
        my $self = shift;
        my @rout;
-       foreach my $u (${$self->{users}}) {
+       foreach my $u (@{$self->{users}}) {
                my $uref = Route::User::get($u);
                push @rout, $self->del_user($uref) if $uref;
        }
@@ -198,7 +198,7 @@ sub new
        confess "already have $call in $pkg" if $list{$call};
        
        my $self = $pkg->SUPER::new($call);
-       $self->{dxchan} = ref $pkg ? [ $pkg->{call} ] : [ ];
+       $self->{dxchan} = [ ];
        $self->{version} = shift || 5000;
        $self->{flags} = shift || Route::here(1);
        $self->{users} = [];