From: Dirk Koopman Date: Tue, 11 Feb 2025 17:14:45 +0000 (+0000) Subject: fix difft, move suspicious test after dup_add X-Git-Url: http://scm.dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=6562e85a3a3124c8fd5fd0796692de3d54193aed;p=spider.git fix difft, move suspicious test after dup_add --- diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 32ba0db0..853349a1 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -127,6 +127,7 @@ sub handle_10 # if this is a 'nodx' node then ignore it if ($badnode->in($pc->[6], $preserve_node_ssid) || ($via && $badnode->in($via, $preserve_node_ssid))) { dbg($line) if isdbg('nologchan'); + $via ||= '*'; dbg("PCPROT: Bad Node $pc->[6]/$via, dropped"); return; } @@ -385,11 +386,39 @@ sub handle_11 } } + # we until here to do any censorship to try and reduce the amount of noise that repeated copies + # from other connected nodes cause + if ($censorpc) { + my @bad; + if (@bad = BadWords::check($pc->[5])) { + my $bw = join ', ', @bad; + dbg($line) if isdbg('nologchan'); + dbg("PCPROT: Badwords: '$bw', dropped"); + return; + } + } + + # this goes after the input filtering, but before the actual add + # of the spot so that if it is input filtered, it isn't added to the dup + # list. This allows it to come in from a "legitimate" source + # + ## NOTE: this is where we FINALLY insert the spot into the DXDupe cache + ## + ## Jan 2025 - I have moved this here so that ONLY potential spots for + ## output to users are added to the duplicate cache + # + # + + if (Spot::dup_add(0, @spot[0..4,7])) { + dbg("PCPROT: Duplicate Spot $self->{call}: $pc->[0] $key ignored\n") if isdbg('chanerr') || isdbg('dupespot') || isdbg('pc11'); + return; + } + # here we verify the spotter is currently connected to the node it says it is one. AKA email sender verify # but without the explicit probe to the node. We are relying on "historical" information, but it very likely # to be current once we have seen the first PC92C from that node. # - # As for spots generated from non-PC92 nodes, we'll see after about do_pc9x3h20m... + # As for spots generated from non-PC92 nodes, we'll see... # if ($senderverify || isdbg('suspicious')) { my $sv = $senderverify; @@ -416,35 +445,7 @@ sub handle_11 return unless $sv < 2; } } - - # we until here to do any censorship to try and reduce the amount of noise that repeated copies - # from other connected nodes cause - if ($censorpc) { - my @bad; - if (@bad = BadWords::check($pc->[5])) { - my $bw = join ', ', @bad; - dbg($line) if isdbg('nologchan'); - dbg("PCPROT: Badwords: '$bw', dropped"); - return; - } - } - - # this goes after the input filtering, but before the actual add - # of the spot so that if it is input filtered, it isn't added to the dup - # list. This allows it to come in from a "legitimate" source - # - ## NOTE: this is where we FINALLY insert the spot into the DXDupe cache - ## - ## Jan 2025 - I have moved this here so that ONLY potential spots for - ## output to users are added to the duplicate cache - # - # - if (Spot::dup_add(0, @spot[0..4,7])) { - dbg("PCPROT: Duplicate Spot $self->{call}: $pc->[0] $key ignored\n") if isdbg('chanerr') || isdbg('dupespot') || isdbg('pc11'); - return; - } - # # Now finally: save the spot itself and send it on its merry way to the users # diff --git a/perl/DXUtil.pm b/perl/DXUtil.pm index b60b0b0b..1364c70a 100644 --- a/perl/DXUtil.pm +++ b/perl/DXUtil.pm @@ -586,7 +586,7 @@ sub diffms sub difft { my $b = shift; - my $adds = shift // 0; + my $adds = shift || 0; my $t; if (ref $b eq 'ARRAY') {