]> gb7djk.dxcluster.net Git - spider.git/commitdiff
fix difft, move suspicious test after dup_add
authorDirk Koopman <djk@tobit.co.uk>
Tue, 11 Feb 2025 17:14:45 +0000 (17:14 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Tue, 11 Feb 2025 17:14:45 +0000 (17:14 +0000)
perl/DXProtHandle.pm
perl/DXUtil.pm

index 32ba0db0d931ab6c492962608ea547fab75d23fa..853349a165eb51f0805abfc33f78b04947cb5c93 100644 (file)
@@ -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
        #
index b60b0b0b1de4c444e301f86aa04404ed3d666b61..1364c70ad16535a44e100f186fe0277b27a21cf1 100644 (file)
@@ -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') {