projects
/
spider.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
80a2dd3
)
added announce deduping and filtering
author
djk
<djk>
Tue, 18 May 1999 21:28:01 +0000
(21:28 +0000)
committer
djk
<djk>
Tue, 18 May 1999 21:28:01 +0000
(21:28 +0000)
changed dup connect semantics
Changes
patch
|
blob
|
history
perl/DXProt.pm
patch
|
blob
|
history
perl/cluster.pl
patch
|
blob
|
history
diff --git
a/Changes
b/Changes
index be97d3a6afb839c2ec3d8b731de1e187c1c4652b..35feff184e3a0127fe8782f1b385214e69c2ec22 100644
(file)
--- a/
Changes
+++ b/
Changes
@@
-1,3
+1,5
@@
+18May99=======================================================================
+1. Added announce dup checking.
08May99=======================================================================
1. Added a bit more checking to the rcmd thing to make more sure that this
rcmd isn't coming from an imposter. Not possible to prevent everything
08May99=======================================================================
1. Added a bit more checking to the rcmd thing to make more sure that this
rcmd isn't coming from an imposter. Not possible to prevent everything
diff --git
a/perl/DXProt.pm
b/perl/DXProt.pm
index 7ef99411fd7d099d1de5e8838e867d02a2f6b5dd..5bda044a045644a3a8687c2ff4e36828c9958bec 100644
(file)
--- a/
perl/DXProt.pm
+++ b/
perl/DXProt.pm
@@
-30,14
+30,17
@@
use Carp;
use strict;
use vars qw($me $pc11_max_age $pc11_dup_age $pc23_dup_age
%spotdup %wwvdup $last_hour %pings %rcmds
use strict;
use vars qw($me $pc11_max_age $pc11_dup_age $pc23_dup_age
%spotdup %wwvdup $last_hour %pings %rcmds
- %nodehops @baddx $baddxfn);
+ %nodehops @baddx $baddxfn $pc12_dup_age
+ %anndup);
$me = undef; # the channel id for this cluster
$pc11_max_age = 1*3600; # the maximum age for an incoming 'real-time' pc11
$pc11_dup_age = 24*3600; # the maximum time to keep the spot dup list for
$pc23_dup_age = 24*3600; # the maximum time to keep the wwv dup list for
$me = undef; # the channel id for this cluster
$pc11_max_age = 1*3600; # the maximum age for an incoming 'real-time' pc11
$pc11_dup_age = 24*3600; # the maximum time to keep the spot dup list for
$pc23_dup_age = 24*3600; # the maximum time to keep the wwv dup list for
+$pc12_dup_age = 24*3600; # the maximum time to keep the ann dup list for
%spotdup = (); # the pc11 and 26 dup hash
%spotdup = (); # the pc11 and 26 dup hash
-%wwvdup = (); # the pc23 and 27 dup hash
+%wwvdup = (); # the pc23 and 27 dup hash
+%anndup = (); # the PC12 dup hash
$last_hour = time; # last time I did an hourly periodic update
%pings = (); # outstanding ping requests outbound
%rcmds = (); # outstanding rcmd requests outbound
$last_hour = time; # last time I did an hourly periodic update
%pings = (); # outstanding ping requests outbound
%rcmds = (); # outstanding rcmd requests outbound
@@
-235,6
+238,21
@@
sub normal
}
if ($pcno == 12) { # announces
}
if ($pcno == 12) { # announces
+ # announce duplicate checking
+ my $text = uc unpad($field[3]);
+ my $dupkey = $field[1].$field[2].$text.$field[4].$field[6];
+ if ($anndup{$dupkey}) {
+ dbg('chan', "Duplicate Announce ignored\n");
+ return;
+ }
+ $anndup{$dupkey} = $main::systime;
+
+ # global ann filtering
+ my ($filter, $hops) = Filter::it($self->{annfilter}, @field[1..6], $self->{call} ) if $self->{annfilter};
+ if ($self->{annfilter} && !$filter) {
+ dbg('chan', "Rejected by filter");
+ return;
+ }
if ($field[2] eq '*' || $field[2] eq $main::mycall) {
if ($field[2] eq '*' || $field[2] eq $main::mycall) {
@@
-646,6
+664,10
@@
sub process
while (($key, $val) = each %wwvdup) {
delete $wwvdup{$key} if $val < $cutoff;
}
while (($key, $val) = each %wwvdup) {
delete $wwvdup{$key} if $val < $cutoff;
}
+ $cutoff = $main::systime - $pc12_dup_age;
+ while (($key, $val) = each %anndup) {
+ delete $anndup{$key} if $val < $cutoff;
+ }
$last_hour = $main::systime;
}
}
$last_hour = $main::systime;
}
}
diff --git
a/perl/cluster.pl
b/perl/cluster.pl
index b1b330b2c983f1377ed82faf0dba5397b38d9886..bfd9bb094ba4655fb6313346688ae572b7f2110e 100755
(executable)
--- a/
perl/cluster.pl
+++ b/
perl/cluster.pl
@@
-107,13
+107,14
@@
sub rec
my ($sort, $call, $line) = $msg =~ /^(\w)(\S+)\|(.*)$/;
# is there one already connected to me ?
my ($sort, $call, $line) = $msg =~ /^(\w)(\S+)\|(.*)$/;
# is there one already connected to me ?
- if ($dxchan = DXChannel->get($call)) {
- disconnect($dxchan);
- sleep(1);
+ my $user = DXUser->get($call);
+ if (DXChannel->get($call)) {
+ my $mess = DXM::msg($lang, $user->sort eq 'A' ? 'concluster' : 'conother', $call);
+ already_conn($conn, $call, $mess);
+ return;
}
# is there one already connected elsewhere in the cluster (and not a cluster)
}
# is there one already connected elsewhere in the cluster (and not a cluster)
- my $user = DXUser->get($call);
if ($user) {
if (($user->sort eq 'A' || $call eq $myalias) && !DXCluster->get_exact($call)) {
;
if ($user) {
if (($user->sort eq 'A' || $call eq $myalias) && !DXCluster->get_exact($call)) {
;