From: minima Date: Tue, 6 Jul 2004 21:52:48 +0000 (+0000) Subject: and a bit more X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b9ac5347cb32b8511a9cec13ef89c14683df995e;p=spider.git and a bit more --- diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 51bdc8ef..497a2671 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -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()); } diff --git a/perl/Route/Node.pm b/perl/Route/Node.pm index 6f8de6de..3c0feb4b 100644 --- a/perl/Route/Node.pm +++ b/perl/Route/Node.pm @@ -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} = [];