allow sh/qrz to use a http proxy
[spider.git] / perl / Route / Node.pm
index ac20b7d8de3266bc5d6ebeefcc0cd652fde05cef..51ecedea2bb6575c9d58220cba96011e696cd9e4 100644 (file)
@@ -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,6 +128,9 @@ 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}};
@@ -205,7 +209,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 +262,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');
 }
 
 #