try to sort out PC16 so that local connections override and update remote
authorminima <minima>
Tue, 16 Jan 2007 11:37:41 +0000 (11:37 +0000)
committerminima <minima>
Tue, 16 Jan 2007 11:37:41 +0000 (11:37 +0000)
ones.

perl/DXProt.pm
perl/DXProtHandle.pm
perl/Route/Node.pm

index 010620a0f67725a5c8323d322a4b699a70787735..33f962fda2cd583cde3a12d18d2c3ea1d30f2273 100644 (file)
@@ -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;
index a62c6bef77de07b90cbf6a41711cc6f58708e6e5..9d287df45133b1e3925e26d01a40b6c69a907a61 100644 (file)
@@ -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) {
index 10a45eaef7a8da949af57e550a550392bfc58ab7..ccbd91d1e1ce4b28da7b0a50985b8e5477f54fc2 100644 (file)
@@ -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;