From: minima Date: Tue, 16 Jan 2007 11:37:41 +0000 (+0000) Subject: try to sort out PC16 so that local connections override and update remote X-Git-Tag: 1.54~26 X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=217d9d54b6772ed24aee88d5dc968a64de54f531;p=spider.git try to sort out PC16 so that local connections override and update remote ones. --- diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 010620a0..33f962fd 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -241,7 +241,7 @@ sub new # old style connections, because we are about to get the real deal if (my $ref = Route::Node::get($call)) { dbg("ROUTE: $call is already in the routing table, deleting") if isdbg('route'); - my @rout = $ref->del_nodes; + my @rout = $ref->delete; $self->route_pc21($main::mycall, undef, @rout) if @rout; } $main::routeroot->add($call, '5000', Route::here(1)) if $call ne $main::mycall; diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index a62c6bef..9d287df4 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -423,6 +423,10 @@ sub handle_16 my $h; $h = 1 if DXChannel::get($ncall); RouteDB::update($ncall, $self->{call}, $h); + if ($h && $self->{call} ne $ncall) { + dbg("PCPROT: trying to update a local node, ignored") if isdbg('chanerr'); + return; + } if (eph_dup($line)) { dbg("PCPROT: dup PC16 detected") if isdbg('chanerr'); @@ -764,7 +768,7 @@ sub handle_19 # but remember there will only be one (pair) these because any extras will be # thrown away. if (@rout) { - $self->route_pc21($self->{call}, $line, @rout); +# $self->route_pc21($self->{call}, $line, @rout); $self->route_pc19($self->{call}, $line, @rout); } if (@pc92out) { diff --git a/perl/Route/Node.pm b/perl/Route/Node.pm index 10a45eae..ccbd91d1 100644 --- a/perl/Route/Node.pm +++ b/perl/Route/Node.pm @@ -113,6 +113,20 @@ sub del return @nodes; } +# this deletes this node completely by grabbing the parents +# and deleting me from them +sub delete +{ + my $self = shift; + my @out; + + $self->_del_users; + foreach my $parent (@{$self->{parent}}) { + push @out, $parent->del($self); + } + return @out; +} + sub del_nodes { my $parent = shift;