X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FRoute%2FNode.pm;h=e29fe3caefb1eeb393dd1322ff21f99ee3428888;hb=3e075e9d00d74fd477c44db2b29eb3eac9d6d88a;hp=ac20b7d8de3266bc5d6ebeefcc0cd652fde05cef;hpb=1fae727d9da6945d99ccdcb79436eb579b47a3b7;p=spider.git diff --git a/perl/Route/Node.pm b/perl/Route/Node.pm index ac20b7d8..e29fe3ca 100644 --- a/perl/Route/Node.pm +++ b/perl/Route/Node.pm @@ -83,12 +83,13 @@ sub del # delete parent from this call's parent list my $pcall = $pref->{call}; + my $ncall = $self->{call}; + $pref->_delnode($ncall);; my $ref = $self->_delparent($pcall); my @nodes; # is this the last connection, I have no parents anymore? unless (@$ref) { - my $ncall = $self->{call}; foreach my $rcall (@{$self->{nodes}}) { next if grep $rcall eq $_, @_; my $r = Route::Node::get($rcall); @@ -127,11 +128,19 @@ sub add_user { my $self = shift; my $ucall = shift; + + confess "Trying to add NULL User call to routing tables" unless $ucall; + $self->_adduser($ucall); $self->{usercount} = scalar @{$self->{users}}; my $uref = Route::User::get($ucall); - my @out = (Route::User->new($ucall, $self->{call}, @_)) unless $uref; + my @out; + if ($uref) { + $uref->addparent($self->{call}); + } else { + @out = Route::User->new($ucall, $self->{call}, @_); + } return @out; } @@ -205,7 +214,7 @@ sub get my $call = shift; $call = shift if ref $call; my $ref = $list{uc $call}; - dbg('routerr', "Failed to get Node $call" ) unless $ref; + dbg("Failed to get Node $call" ) if !$ref && isdbg('routerr'); return $ref; } @@ -258,7 +267,7 @@ sub DESTROY my $pkg = ref $self; my $call = $self->{call} || "Unknown"; - dbg('route', "destroying $pkg with $call"); + dbg("destroying $pkg with $call") if isdbg('routelow'); } #