]> scm.dxcluster.org Git - spider.git/commitdiff
mprove Filter debgging
authorDirk Koopman <djk@tobit.co.uk>
Mon, 3 Feb 2025 16:52:20 +0000 (16:52 +0000)
committerDirk Koopman <djk@tobit.co.uk>
Mon, 3 Feb 2025 16:52:20 +0000 (16:52 +0000)
Changes
perl/DXProt.pm
perl/DXProtHandle.pm
perl/Filter.pm

diff --git a/Changes b/Changes
index 3c52892dce9bddb7f5c8cdbd24fa3c1f5a5357be..9235a7478b54e3912c6b6eefb83c8bdccca1bc95 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,20 @@
+03Jan25======================================================================
+1. Filter cleanup (especially filter debugging)
+31Jan25======================================================================
+1. Fixed botched node link initialisation check. This what prevent ann/full
+   working and would have stopped talk, rcmd etc etc. 
+2. Added a field called 'state' to the who command to allow sysops to
+   diagnose some connection initialisation problems. 
+3. Add some callsigns to badnode/badspotter callsigns in debug messages.
+29Jan25======================================================================
+1. Fix dx command <cough>. "I never changed that bit". If I had this would
+   never have happened. 
+2. Fixed another fix that was to do with deduping and thus cause locally 
+   generated spots to be stored in the local spot files again. 
+3. Made an attempt to allow perl regex filter statements to work on callsigns
+   as well comments and other text fields. This means that:
+       reject/spot call {wwa$} or info {w\s*\w\*a} 
+   will likely reduce your spots considerably.  
 28Jan25======================================================================
 1. Set default Spot qrg granularity to 1KHz (was 25KHz).
 2. Refine Incoming CCLuster connection handling. It is a requirement that a
index c790eaa95afc96adc6ad852fdef3e704cb986a8b..f1588c8a3bfe843e8d46585f124308f3881589d1 100644 (file)
@@ -1475,7 +1475,7 @@ sub send_route
                                if ($filter) {
                                        push @rin, $r;
                                } else {
-                                       dbg("PCPROT: $self->{call}/" . $r->call . " rejected by output filter") if isdbg('filter');
+                                       dbg("PCPROT: send_route $self->{call}/" . $r->call . " rejected by output filter") if isdbg('filter');
                                }
                        } else {
                                dbg("was sent a null value") if isdbg('chanerr');
index ae6e7f863a23e2a06d11c4f740aeeb599e12d1f1..77db15e3cd96872f6f3f90f246c22a02da8a8dc0 100644 (file)
@@ -113,7 +113,7 @@ sub handle_10
        # if this is a 'nodx' node then ignore it
        if ($badnode->in($pc->[6]) || ($via && $badnode->in($via))) {
                dbg($line) if isdbg('nologchan');
-               dbg("PCPROT: Bad Node, dropped");
+               dbg("PCPROT: Bad Node $pc->[6]/$via, dropped");
                return;
        }
 
@@ -122,7 +122,7 @@ sub handle_10
        $nossid =~ s/-\d+$//;
        if ($badspotter->in($nossid)) {
                dbg($line) if isdbg('nologchan');
-               dbg("PCPROT: Bad Spotter, dropped");
+               dbg("PCPROT: Bad Spotter $nossid, dropped");
                return;
        }
 
@@ -256,7 +256,7 @@ sub handle_11
        # is this is a 'bad spotter' or an unknown user then ignore it. 
        if ($badspotter->in($nossid)) {
                dbg($line) if isdbg('nologchan');
-               dbg("PCPROT: Bad Spotter $pc->[6], dropped");
+               dbg("PCPROT: Bad Spotter $nossid, dropped");
                return;
        }
 
@@ -594,7 +594,7 @@ sub handle_12
        # if this is a 'nodx' node then ignore it
        if ($badnode->in($pc->[5])) {
                dbg($line) if isdbg('nologchan');
-               dbg("PCPROT: Bad Node, dropped");
+               dbg("PCPROT: Bad Node $pc->[5], dropped");
                return;
        }
 
@@ -603,7 +603,7 @@ sub handle_12
        $nossid =~ s/-\d+$//;
        if ($badspotter->in($nossid)) {
                dbg($line) if isdbg('nologchan');
-               dbg("PCPROT: Bad Spotter, dropped");
+               dbg("PCPROT: Bad Spotter $nossid, dropped");
                return;
        }
 
@@ -2521,7 +2521,7 @@ sub handle_93
        $nossid =~ s/-\d+$//;
        if ($badspotter->in($nossid)) {
                dbg($line) if isdbg('nologchan');
-               dbg("PCPROT: Bad Spotter, dropped");
+               dbg("PCPROT: Bad Spotter $nossid, dropped");
                return;
        }
 
index 1c6b8589f93e803b8b9ca332d146737ce88709b2..53b7d64b498233ab4e020a95130982fe892d63ca 100644 (file)
@@ -251,8 +251,14 @@ sub it
        my $key;
        my $type = 'Dunno';
        my $asc = '?';
+       
+       my $r = 1;
+       my $reason = '';
+       
+       my $hit = undef;
+       my $true = 'PASS';
+   
 
-       my $r = @keys > 0 ? 0 : 1;
        foreach $key (@keys) {
                $filter = $self->{$key};
                if ($filter->{reject} && exists $filter->{reject}->{code}) {
@@ -260,8 +266,12 @@ sub it
                        $asc = $filter->{reject}->{user};
                        if (&{$filter->{reject}->{code}}(ref $_[0] ? $_[0] : \@_)) {
                                $r = 0;
+                               $true = 'REJ ';
+                               $hit = $filter->{reject};
+                               $reason = $hit->{user};
                                last;
                        } else {
+                               $true = 'OK ';
                                $r = 1;
                        }               
                }
@@ -270,11 +280,15 @@ sub it
                        $asc = $filter->{accept}->{user};
                        if (&{$filter->{accept}->{code}}(ref $_[0] ? $_[0] : \@_)) {
                                $r = 1;
+                               $true = 'ACC ';
+                               $hit = $filter->{accept};
+                               $reason = $hit->{user};
                                last;
                        } else {
+                               $true = 'OK ';
                                $r = 0;
                        }                       
-               } 
+               }
        }
 
        # hops are done differently (simply) 
@@ -282,14 +296,17 @@ sub it
 
        if (isdbg('filter')) {
                my $call = $self->{name};
-               my $args = join '\',\'', map {defined $_ ? $_ : 'undef'} (ref $_[0] ? @{$_[0]} : @_);
-               my $true = $r ? "OK " : "REJ";
+               my $args = join ', ', map {defined $_ ? $_ : 'undef'} (ref $_[0] ? @{$_[0]} : @_);
                my $sort = $self->{sort};
                my $dir = $self->{name} =~ /^in_/i ? "IN " : "OUT";
 
                $call =~ s/\.PL$//i;
-               my $h = $hops || '';
-               dbg("Filter: $call $true $dir: $type/$sort with '$asc' on '$args' $h") if isdbg('filter');
+               my $h = " hops: $hops" || '';
+               if ($reason) {
+                       dbg("Filter: $call $true $dir $type/$sort '$reason' on '$args'") if isdbg('filter');
+               } else {
+                       dbg("Filter: $call $true $dir on '$args'") if isdbg('filter');
+               }
        }
        return ($r, $hops);
 }