projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3a975cc
)
fix PC16 output problem
author
minima
<minima>
Sat, 9 Jun 2001 13:53:17 +0000
(13:53 +0000)
committer
minima
<minima>
Sat, 9 Jun 2001 13:53:17 +0000
(13:53 +0000)
perl/DXProt.pm
patch
|
blob
|
history
perl/DXProtout.pm
patch
|
blob
|
history
diff --git
a/perl/DXProt.pm
b/perl/DXProt.pm
index 3f4575aa3907ca18ac361c364d5978eaff05a2e9..dbe7faf8e7f63340b3ee4ef262e8ea7505ed6380 100644
(file)
--- a/
perl/DXProt.pm
+++ b/
perl/DXProt.pm
@@
-35,7
+35,7
@@
use Route::Node;
use strict;
use vars qw($me $pc11_max_age $pc23_max_age
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);
%nodehops $baddx $badspotter $badnode $censorpc
$allowzero $decode_dk0wcy $send_opernam @checklist);
@@
-52,6
+52,7
@@
$censorpc = 1; # Do a BadWords::check on text fields and reject things
$baddx = new DXHash "baddx";
$badspotter = new DXHash "badspotter";
$badnode = new DXHash "badnode";
$baddx = new DXHash "baddx";
$badspotter = new DXHash "badspotter";
$badnode = new DXHash "badnode";
+$last10 = time;
@checklist =
(
@checklist =
(
@@
-1070,9
+1071,13
@@
sub normal
# NOTE - don't arrive here UNLESS YOU WANT this lump of protocol to be
# REBROADCAST!!!!
#
# 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
+ }
}
}
}
}
@@
-1108,14
+1113,17
@@
sub process
}
}
}
}
}
}
+
+ # 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) {
if ($main::systime - 3600 > $last_hour) {
-# Spot::process;
-# Geomag::process;
-# AnnTalk::process;
$last_hour = $main::systime;
}
}
$last_hour = $main::systime;
}
}
@@
-1748,5
+1756,27
@@
sub route_pc21
broadcast_route($self, \&pc21, scalar @_, @_);
}
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__
1;
__END__
diff --git
a/perl/DXProtout.pm
b/perl/DXProtout.pm
index 786d78c0f8d08c8be09704d6fdbd81bd8bd06567..a9478812d13cb513f4541ceeffaaa15de3de074c 100644
(file)
--- a/
perl/DXProtout.pm
+++ b/
perl/DXProtout.pm
@@
-78,8
+78,8
@@
sub pc16
my $ncall = $node->call;
my @out;
my $ncall = $node->call;
my @out;
- my $str = "PC16^$ncall";
while (@_) {
while (@_) {
+ my $str = "PC16^$ncall";
for ( ; @_ && length $str < 200; ) {
my $ref = shift;
$str .= sprintf "^%s %s %d", $ref->call, $ref->conf ? '*' : '-', $ref->here;
for ( ; @_ && length $str < 200; ) {
my $ref = shift;
$str .= sprintf "^%s %s %d", $ref->call, $ref->conf ? '*' : '-', $ref->here;