From: Dirk Koopman Date: Fri, 6 Jul 2007 09:01:18 +0000 (+0100) Subject: Fix the over midnight ID rollover calculation X-Git-Tag: 1.55~112 X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=commitdiff_plain;h=ca3a14c5a22a621e9b69ecf0acc2a5da08c5ab91;p=spider.git Fix the over midnight ID rollover calculation Also use a big enough past age limit to cope with inactive nodes that only output a config record and nowt much else, so that they don't time out. Add an 'id too far in the future' compared with current systime check. --- diff --git a/Changes b/Changes index 5708fce2..138b8740 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,9 @@ +06Jul07======================================================================= +1. re-arrange id checking so that it is more logical and check that config +records, that can be an hour coming, are not thoughtlessly ignored, thus +causing nodes to time out. +2. Make sure that the 'over midnight' distance calculation actually does what +is required! 05Jul07======================================================================= 1. Try to make sure that the node config broadcasts are actually sent... 03Jul07======================================================================= diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 7d2968ce..a42ba33e 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -46,7 +46,8 @@ use vars qw($pc11_max_age $pc23_max_age $last_pc50 $eph_restime $eph_info_restim $eph_pc15_restime $pc9x_past_age $pc9x_future_age ); -$pc9x_past_age = 15*60; # maximum age in the past of a px9x +$pc9x_past_age = 62*60; # maximum age in the past of a px9x (a config record might be the only + # thing a node might send - once an hour) $pc9x_future_age = 5*60; # maximum age in the future ditto # incoming talk commands @@ -1422,14 +1423,19 @@ sub check_pc9x_t if ($parent->call ne $main::mycall) { my $lastid = $parent->lastid->{$pc} || 0; if ($t < $lastid) { - if ($lastid-86400+$t > $pc9x_past_age) { - dbg("PCPROT: dup id on $t <= $lastid (midnight rollover), ignored") if isdbg('chanerr'); + if ($t+86400-$lastid > $pc9x_past_age) { + dbg("PCPROT: dup id on $t <= $lastid, ignored") if isdbg('chanerr'); return; } - } - if ($lastid >= $t) { - dbg("PCPROT: dup id on $call $lastid >= $t, ignored") if isdbg('chanerr'); + } elsif ($t == $lastid) { + dbg("PCPROT: dup id on $t == $lastid, ignored") if isdbg('chanerr'); return; + } else { + # $t > $lastid, check that the timestamp offered isn't too far away from 'now' + if ($t+$main::systime_daystart-$main::systime > $pc9x_future_age ) { + dbg("PCPROT: id $t too far in the future, ignored") if isdbg('chanerr'); + return; + } } } } elsif ($create) { diff --git a/perl/Version.pm b/perl/Version.pm index 3a0dca8b..d6dc5475 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 = '102'; +$build = '103'; 1;