add more debugging and (possibly) fix the problem.
[spider.git] / perl / DXProtHandle.pm
index 526762e514d623b72d8c1b18ca49e09403ac205a..f0dd2760765f3fc6dc0e0a734d935681cd57504e 100644 (file)
@@ -605,9 +605,9 @@ sub handle_18
                        $self->user->put;
                        $self->sort('S');
                }
-               $self->{handle_xml}++ if DXXml::available() && $_[1] =~ /\bxml\b/;
-               my ($pc9x) = $_[1] =~ /\bpc9\[(\d+)\]\b/;
-               $self->{do_pc92}++ if (defined $pc9x && $pc9x =~ /2/) || $_[1] =~ /\bpc92\b/;
+               $self->{handle_xml}++ if DXXml::available() && $_[1] =~ /\bxml/;
+               my ($pc9x) = $_[1] =~ /\bpc9\[(\d+)\]/;
+               $self->{do_pc92}++ if defined $pc9x && $pc9x =~ /2/;
        } else {
                $self->version(50.0);
                $self->version($_[2] / 100) if $_[2] && $_[2] =~ /^\d+$/;
@@ -1458,6 +1458,8 @@ sub handle_92
        $parent->do_pc92(1);
        $parent->via_pc92(1);
        $parent->reset_obs;
+       dbg("ROUTE: reset obscount on $pcall now " . $parent->obscount) if isdbg('route');
+
 
        if (@ent) {
 
@@ -1470,13 +1472,21 @@ sub handle_92
                                return;
                        }
                        if ($is_extnode) {
+                               # this is only accepted from my "self"
+                               if (DXChannel::get($call) && $call ne $self->{call}) {
+                                       dbg("PCPROT: locally connected node config for $call from other another node $self->{call}, ignored") if isdbg('chanerr');
+                                       return;
+                               }
                                # reparent to external node (note that we must have received a 'C' or 'A' record
                                # from the true parent node for this external before we get one for the this node
                                unless ($parent = Route::Node::get($call)) {
                                        dbg("PCPROT: no previous C or A for this external node received, ignored") if isdbg('chanerr');
                                        return;
                                }
-                               my $parent = check_pc9x_t($call, $t, 92) || return;
+                               $parent = check_pc9x_t($call, $t, 92) || return;
+                               $parent->via_pc92(1);
+                               $parent->reset_obs;
+                               dbg("ROUTE: reset obscount on $pcall now " . $parent->obscount) if isdbg('route');
                        }
                } else {
                        dbg("PCPROT: must be mycall or external node as first entry, ignored") if isdbg('chanerr');
@@ -1485,8 +1495,6 @@ sub handle_92
                $parent->here(Route::here($here));
                $parent->version($version) if $version && $version > $parent->version;
                $parent->build($build) if $build && $build > $parent->build;
-               $parent->via_pc92(1);
-               $parent->reset_obs;
                shift @ent;
        }