add better debugging to pc92 deduping check
[spider.git] / perl / DXProtHandle.pm
index f7f8d0742eb8ecb3ac9090c33be3787ffe8f4c9c..f18089ffaa07db020cfde2bb724ef7e65220cb7f 100644 (file)
@@ -2,7 +2,7 @@
 #
 # This module impliments the handlers for the protocal mode for a dx cluster
 #
-# Copyright (c) 1998-2006 Dirk Koopman G1TLH
+# Copyright (c) 1998-2007 Dirk Koopman G1TLH
 #
 #
 #
@@ -1490,25 +1490,33 @@ sub check_pc9x_t
                        if (defined $lastid) {
                                if ($t < $lastid) {
                                        if ($t+86400-$lastid > $pc9x_past_age) {
-                                               dbg("PCPROT: dup id on $t <= lastid $lastid, ignored") if isdbg('chanerr');
-                                               return;
+                                               dbg("PCPROT: dup id on $t <= lastid $lastid, ignored") if isdbg('chanerr') || isdbg('pc92dedupe');
+                                               return undef;
                                        }
                                } elsif ($t == $lastid) {
-                                       dbg("PCPROT: dup id on $t == lastid $lastid, ignored") if isdbg('chanerr');
-                                       return;
+                                       dbg("PCPROT: dup id on $t == lastid $lastid, ignored") if isdbg('chanerr') || isdbg('pc92dedupe');
+                                       return undef;
                                } else {
                                        # $t > $lastid, check that the timestamp offered isn't too far away from 'now'
                                        if ($t-$lastid > $pc9x_future_age ) {
-                                               dbg("PCPROT: id $t too far in the future of lastid $lastid, ignored") if isdbg('chanerr');
-                                               return;
+                                               dbg("PCPROT: id $t too far in the future of lastid $lastid, ignored") if isdbg('chanerr') || isdbg('pc92dedupe');
+                                               return undef;
                                        }
                                }
                        }
                }
        } elsif ($create) {
                $parent = Route::Node->new($call);
+       } else {
+               return undef;
        }
-       $parent->lastid($t) if $parent;
+       if ('pc92dedupe') {
+               my $exists = exists $parent->{lastid}; # naughty, naughty :-)
+               my $val = $parent->{lastid};
+               my $s = $exists ? (defined $val ? $val : 'exists/undef') : 'undef';
+               dbg("PCPROT: $call pc92 id lastid $s -> $t");
+       }
+       $parent->lastid($t);
 
        return $parent;
 }
@@ -1667,6 +1675,9 @@ sub handle_92
 
                        push @radd, $add if $add;
                        $parent->reset_obs;
+                       $parent->version($ent[4]) if $ent[4];
+                       $parent->build($ent[5]) if $ent[5];
+
                        dbg("ROUTE: reset obscount on $parent->{call} now " . $parent->obscount) if isdbg('obscount');
                }
        } elsif ($sort eq 'A' || $sort eq 'D' || $sort eq 'C') {