From: minima Date: Wed, 17 Jan 2007 00:22:01 +0000 (+0000) Subject: force a disconnect down all other interfaces if a node connects directly X-Git-Tag: 1.53~12 X-Git-Url: http://gb7djk.dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=43a8ee12581aa51eb93cd8958b429077f22df76d;hp=c95ba25e119b816208c2f8fc5a584dec9b77ec80;p=spider.git force a disconnect down all other interfaces if a node connects directly thus (hopefully) clearing out the old inflated number of users with the real data direct from the node. --- diff --git a/Changes b/Changes index b8f6df82..f4bc2d82 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +16Jan06======================================================================= +1. back ported a change to PC16 handling so that a locally connected node's +info clears out and generally overrides any residual PC16 info gathered from +elsewhere. 15Jan06======================================================================= 1. added CTY-1701 07Jan06======================================================================= diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 41c38f1a..7a9e4ca1 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -235,6 +235,14 @@ sub new # add this node to the table, the values get filled in later my $pkg = shift; my $call = shift; + + # if we have an entry already, then send a PC21 to all connect + # 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->delete; + $self->route_pc21($main::mycall, undef, @rout) if @rout; + } $main::routeroot->add($call, '5000', Route::here(1)) if $call ne $main::mycall; return $self; @@ -739,7 +747,11 @@ sub handle_16 } # is it me? if ($ncall eq $main::mycall) { - dbg("PCPROT: trying to alter config on this node from outside!") if isdbg('chanerr'); + dbg("PCPROT: trying to alter my config from outside!") if isdbg('chanerr'); + return; + } + if (DXChannel::get($ncall) && $ncall ne $self->{call}) { + dbg("PCPROT: trying to alter locally connected $ncall from $self->{call}, ignored") if isdbg('chanerr'); return; } diff --git a/perl/Route/Node.pm b/perl/Route/Node.pm index d3b1e955..78cd05e4 100644 --- a/perl/Route/Node.pm +++ b/perl/Route/Node.pm @@ -111,6 +111,21 @@ 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 $call (@{$self->{parent}}) { + my $parent = Route::Node::get($call); + push @out, $parent->del($self) if $parent; + } + return @out; +} + sub del_nodes { my $parent = shift;