summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
f7d12c1)
Try to reduce the no of duplicate PC92C for external PC protocol
nodes by listening for others that are out there and bumping up our
update time instead of us transmitting more or less the same info
as well.
$chatdupeage = 20 * 60;
$chatimportfn = "$main::root/chat_import";
$investigation_int = 12*60*60; # time between checks to see if we can see this node
$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
$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
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}) {
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));
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);
}
$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/;
$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);
} else {
dbg("Unknown software");
$self->version(50.0);
$self->user->version($self->version);
}
$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;
# 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_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;
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++;
} 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
}
# 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}) {
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;
}
dbg("PCPROT: locally connected node $call from other another node $self->{call}, ignored") if isdbg('chanerr');
return;
}
return;
}
$parent->here(Route::here($here));
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;
$parent->build($build) if $build && $build > $parent->build;
$parent->PC92C_dxchan($self->{call}) unless $self->{call} eq $parent->call;
shift @ent;
-use vars qw($sentencelth);
+use vars qw($sentencelth $pc19_version);
my $here = $ref->here;
my $conf = $ref->conf;
my $version = $ref->version;
my $here = $ref->here;
my $conf = $ref->conf;
my $version = $ref->version;
+ $version = $pc19_version unless $version =~ /^\d\d\d\d$/;
+
my $str = "^$here^$call^$conf^$version";
if (length($s) + length($str) > $sentencelth) {
push @out, "PC19" . $s . sprintf "^%s^", get_hops(19);
my $str = "^$here^$call^$conf^$version";
if (length($s) + length($str) > $sentencelth) {
push @out, "PC19" . $s . sprintf "^%s^", get_hops(19);
$self->{obscount} = $obscount;
}
$self->{obscount} = $obscount;
}
+sub measure_pc9x_t
+{
+ my $parent = shift;
+ my $t = shift;
+ my $lastid = $parent->{lastid};
+ if ($lastid) {
+ return ($t < $lastid) ? $t+86400-$lastid : $t - $lastid;
+ } else {
+ return 86400;
+ }
+}
+
sub DESTROY
{
my $self = shift;
sub DESTROY
{
my $self = shift;
$version = '1.54';
$subversion = '0';
$version = '1.54';
$subversion = '0';