use strict;
use vars qw($me $pc11_max_age $pc23_max_age
- $last_hour %pings %rcmds
+ $last_hour $last10 %emph %pings %rcmds
%nodehops $baddx $badspotter $badnode $censorpc
$allowzero $decode_dk0wcy $send_opernam @checklist);
$baddx = new DXHash "baddx";
$badspotter = new DXHash "badspotter";
$badnode = new DXHash "badnode";
+$last10 = time;
@checklist =
(
# NOTE - don't arrive here UNLESS YOU WANT this lump of protocol to be
# REBROADCAST!!!!
#
-
- unless ($self->{isolate}) {
- broadcast_ak1a($line, $self); # send it to everyone but me
+
+ if (emph_dup($line)) {
+ dbg('chan', "PCPROT: Ephemeral dup, dropped");
+ } else {
+ unless ($self->{isolate}) {
+ broadcast_ak1a($line, $self); # send it to everyone but me
+ }
}
}
}
}
}
+
+ # every ten seconds
+ if ($t - $last10 >= 10) {
+ # clean out emphemera
+
+ emph_clean();
+
+ $last10 = $t;
+ }
- my $key;
- my $val;
- my $cutoff;
if ($main::systime - 3600 > $last_hour) {
-# Spot::process;
-# Geomag::process;
-# AnnTalk::process;
$last_hour = $main::systime;
}
}
broadcast_route($self, \&pc21, scalar @_, @_);
}
+sub emph_dup
+{
+ my $s = shift;
+
+ # chop the end off
+ $s =~ s/\^H\d\d?\^?~?@//;
+ return 1 if exists $emph{$s};
+ $emph{$s} = $main::systime;
+ return undef;
+}
+
+sub emph_clean
+{
+ my ($key, $val);
+
+ while (($key, $val) = each %emph) {
+ if ($main::systime - $val > 90) {
+ delete $emph{$key};
+ }
+ }
+}
+
1;
__END__
my $ncall = $node->call;
my @out;
- my $str = "PC16^$ncall";
while (@_) {
+ my $str = "PC16^$ncall";
for ( ; @_ && length $str < 200; ) {
my $ref = shift;
$str .= sprintf "^%s %s %d", $ref->call, $ref->conf ? '*' : '-', $ref->here;