$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
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(60));
+ }
}
}
}
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);
}
$self->sort('S');
}
# $self->{handle_xml}++ if DXXml::available() && $_[1] =~ /\bxml/;
- if ($_[1] =~ /\bpc9x/) {
- if ($self->{isolate}) {
- dbg("pc9x recognised, but $self->{call} is isolated, using old protocol");
- } elsif (!$self->user->wantpc9x) {
- dbg("pc9x explicitly switched off on $self->{call}, using old protocol");
- } else {
- $self->{do_pc9x} = 1;
- dbg("Do px9x set on $self->{call}");
- }
- }
} else {
dbg("Unknown software");
$self->version(50.0);
$self->user->version($self->version);
}
+ if ($_[1] =~ /\bpc9x/) {
+ if ($self->{isolate}) {
+ dbg("pc9x recognised, but $self->{call} is isolated, using old protocol");
+ } elsif (!$self->user->wantpc9x) {
+ dbg("pc9x explicitly switched off on $self->{call}, using old protocol");
+ } else {
+ $self->{do_pc9x} = 1;
+ dbg("Do px9x set on $self->{call}");
+ }
+ }
+
# first clear out any nodes on this dxchannel
my @rout = $parent->del_nodes;
$self->route_pc21($origin, $line, @rout, $parent) if @rout;
my $_last_time;
my $_last_occurs;
+my $_last_pc9x_id;
+
+sub last_pc9x_id
+{
+ return $_last_pc9x_id;
+}
sub gen_pc9x_t
{
if (!$_last_time || $_last_time != $main::systime) {
$_last_time = $main::systime;
$_last_occurs = 0;
- return $_last_time - $main::systime_daystart;
+ return $_last_pc9x_id = $_last_time - $main::systime_daystart;
} else {
$_last_occurs++;
- return sprintf "%d.%02d", $_last_time - $main::systime_daystart, $_last_occurs;
+ return $_last_pc9x_id = sprintf "%d.%02d", $_last_time - $main::systime_daystart, $_last_occurs;
}
}
}
# this is only accepted from my "self".
# this also kills configs from PC92 nodes with external PC19 nodes that are also
- # locally connected. Local nodes always take precedence.
+ # locally connected. Local nodes always take precedence. But we remember the lastid
+ # to try to reduce the number of dupe PC92s for this external node.
if (DXChannel::get($call) && $call ne $self->{call}) {
+ $parent = check_pc9x_t($call, $t, 92); # this will update the lastid time
dbg("PCPROT: locally connected node $call from other another node $self->{call}, ignored") if isdbg('chanerr');
return;
}
return;
}
$parent->here(Route::here($here));
- $parent->version($version) if $version && $version > $parent->version;
+ $parent->version($version || $pc19_version) if $version;
$parent->build($build) if $build && $build > $parent->build;
$parent->PC92C_dxchan($self->{call}) unless $self->{call} eq $parent->call;
shift @ent;