]> dxcluster.org Git - spider.git/commitdiff
add better debugging to pc92 deduping check
authorDirk Koopman <djk@tobit.co.uk>
Sun, 11 Nov 2007 12:45:35 +0000 (12:45 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Sun, 11 Nov 2007 12:45:35 +0000 (12:45 +0000)
perl/DXProtHandle.pm
perl/Version.pm

index 4c7ccf4b256d869e4b6f57910d11e24a1b2214a7..f18089ffaa07db020cfde2bb724ef7e65220cb7f 100644 (file)
@@ -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;
+       }
+       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) if $parent;
+       $parent->lastid($t);
 
        return $parent;
 }
index 780570fe1dc0c437d2f0f2bfc77e3bfed2cf7392..e10f759def25f4b6b9e66affbc6af131a5de35b8 100644 (file)
@@ -11,6 +11,6 @@ use vars qw($version $subversion $build);
 
 $version = '1.54';
 $subversion = '0';
-$build = '177';
+$build = '180';
 
 1;