X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FDXProt.pm;h=eec6b67b2d731730b7df2d52f42c5ee530208d23;hb=7e2b5e1e1f0543a093151889d6e76bcce82bae86;hp=a863b08a96701e02c288b2892704f8c82a0cda16;hpb=da2c51a552ec4aba7af7696fa631324337286949;p=spider.git diff --git a/perl/DXProt.pm b/perl/DXProt.pm index a863b08a..eec6b67b 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -72,7 +72,7 @@ $obscount = 2; $chatdupeage = 20 * 60; $chatimportfn = "$main::root/chat_import"; $investigation_int = 12*60*60; # time between checks to see if we can see this node -$pc19_version = 5466; # the visible version no for outgoing PC19s generated from pc59 +$pc19_version = 5454; # the visible version no for outgoing PC19s generated from pc59 $pc92_update_period = 60*60; # the period between outgoing PC92 C updates $pc92_short_update_period = 15*60; # shorten the update period after a connection %pc92_find = (); # outstanding pc92 find operations @@ -164,7 +164,10 @@ $next_pc92_obs_timeout = $main::systime + 60*60; # the time between obscount cou undef, undef, undef, - [ qw(i c n) ], # pc90 + undef, # pc90 + undef, + [ qw(i c f l)], # pc92 + [ qw(i c f *m c *c m)], # pc93 ); # use the entry in the check list to check the field list presented @@ -181,7 +184,8 @@ sub check for ($i = 1; $i < @$ref; $i++) { my ($blank, $act) = $$ref[$i] =~ /^(b?)(\w)$/; return 0 unless $act; - next if $blank && $_[$i] =~ /^[ \*]$/; + next if $blank eq 'b' && $_[$i] =~ /^[ \*]$/; + next if $blank eq '*' && $_[$i] =~ /^\*$/; if ($act eq 'c') { return $i unless is_callsign($_[$i]); } elsif ($act eq 'i') { @@ -200,6 +204,8 @@ sub check return $i unless $_[$i] =~ /^\s*\d+-\w\w\w-[12][90]\d\d$/; } elsif ($act eq 't') { return $i unless $_[$i] =~ /^[012]\d[012345]\dZ$/; + } elsif ($act eq 'l') { + return $i unless $_[$i] =~ /^[A-Z]$/; } } return 0; @@ -475,11 +481,20 @@ sub process next unless $dxchan->is_node; # send out a PC92 config record if required for me and - # all my non pc9x dependent nodes. + # all my non pc9x dependent nodes. But for dependent nodes we only do + # this if we have not seen any from anyone else for at least half + # of one update period. This should stop quite a bit of excess C + # records. Someone will win, it does not really matter who, because + # we always believe "us". if ($main::systime >= $dxchan->{next_pc92_update}) { dbg("ROUTE: pc92 broadcast candidate: $dxchan->{call}") if isdbg('obscount'); if ($dxchan == $main::me || !$dxchan->{do_pc9x}) { - $dxchan->broadcast_pc92_update($dxchan->{call}); + my $ref = Route::Node::get($dxchan->{call}); + if ($dxchan == $main::me || ($ref && ($ref->measure_pc9x_t($main::systime-$main::systime_daystart)) >= $pc92_update_period/2)) { + $dxchan->broadcast_pc92_update($dxchan->{call}); + } else { + $dxchan->update_pc92_next($pc92_update_period - rand($pc92_update_period/4)); + } } } } @@ -919,6 +934,7 @@ sub broadcast_pc92_update return; } my $l = $nref->last_PC92C(gen_my_pc92_config($nref)); + $nref->lastid(last_pc9x_id()); $main::me->broadcast_route_pc9x($main::mycall, undef, $l, 0); $self->update_pc92_next($pc92_update_period); }