From 4fc769825208defe992b60c1374a236f2cdba925 Mon Sep 17 00:00:00 2001 From: Dirk Koopman Date: Sun, 11 Nov 2007 12:45:35 +0000 Subject: [PATCH 1/1] add better debugging to pc92 deduping check --- perl/DXProtHandle.pm | 22 +++++++++++++++------- perl/Version.pm | 2 +- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 4c7ccf4b..f18089ff 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -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; } diff --git a/perl/Version.pm b/perl/Version.pm index 780570fe..e10f759d 100644 --- a/perl/Version.pm +++ b/perl/Version.pm @@ -11,6 +11,6 @@ use vars qw($version $subversion $build); $version = '1.54'; $subversion = '0'; -$build = '177'; +$build = '180'; 1; -- 2.43.0