projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
improve debugging on filtering?
[spider.git]
/
perl
/
Route
/
Node.pm
diff --git
a/perl/Route/Node.pm
b/perl/Route/Node.pm
index eb2f536bd4e96a55d3a1058b3af2419051094931..4bb4c9ca4812624e43b6ed9170f7504c1d17c16a 100644
(file)
--- a/
perl/Route/Node.pm
+++ b/
perl/Route/Node.pm
@@
-56,14
+56,24
@@
sub max
sub add
{
my $parent = shift;
sub add
{
my $parent = shift;
- my $call = uc shift;
- confess "Route::add trying to add $call to myself" if $call eq $parent->{call};
- my $self = get($call);
+ my $call = shift;
+ my $self;
+
+ if (ref $call) {
+ $self = $call;
+ $call = $self->{call};
+ } else {
+ $self = get($call);
+ }
+
+ confess "Trying to add NULL Node call to routing tables" unless $call;
+
if ($self) {
$self->_addparent($parent->{call});
$parent->_addnode($call);
return undef;
}
if ($self) {
$self->_addparent($parent->{call});
$parent->_addnode($call);
return undef;
}
+ confess "Route::Node::add trying to add $call to myself" if $call eq $parent->{call};
$parent->_addnode($call);
$self = $parent->new($call, @_);
return $self;
$parent->_addnode($call);
$self = $parent->new($call, @_);
return $self;
@@
-128,6
+138,9
@@
sub add_user
{
my $self = shift;
my $ucall = shift;
{
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}};
$self->_adduser($ucall);
$self->{usercount} = scalar @{$self->{users}};
@@
-206,7
+219,7
@@
sub get
my $call = shift;
$call = shift if ref $call;
my $ref = $list{uc $call};
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;
}
return $ref;
}
@@
-259,7
+272,7
@@
sub DESTROY
my $pkg = ref $self;
my $call = $self->{call} || "Unknown";
my $pkg = ref $self;
my $call = $self->{call} || "Unknown";
- dbg(
'route', "destroying $pkg with $call"
);
+ dbg(
"destroying $pkg with $call") if isdbg('routelow'
);
}
#
}
#