From 82236b001650f0e9770d25566a033501ec4fb6f4 Mon Sep 17 00:00:00 2001 From: minima Date: Sat, 9 Jun 2001 02:25:29 +0000 Subject: [PATCH] fixes --- Changes | 4 ++++ perl/DXMsg.pm | 4 ++-- perl/DXProt.pm | 4 +++- perl/Filter.pm | 14 ++++++++++++++ 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 26935f1a..c76ad6eb 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,7 @@ +09Jun01======================================================================= +1. more fixes +2. add set/debug filter so that you can see why your filters aren't working +(for sysops only) 08Jun01======================================================================= 1. first cut with new routing code. Created NEW_ROUTE branch 2. added acc/route and rej/route commands diff --git a/perl/DXMsg.pm b/perl/DXMsg.pm index e27bf802..a992f2ae 100644 --- a/perl/DXMsg.pm +++ b/perl/DXMsg.pm @@ -615,9 +615,9 @@ sub queue_msg if ($clref) { my $dxc = $clref->dxchan; if ($dxc) { - if (grep {my $dxc=$clref->dxchan; $dxc && $dxc == $_ } DXCommandmode::get_all()) { + if (!grep $dxc == $_, DXCommandmode::get_all()) { next if $clref->call eq $main::mycall; # i.e. it lives here - $dxchan = $clref->dxchan; + $dxchan = $dxc; $ref->start_msg($dxchan) if $dxchan && !get_busy($dxchan->call) && $dxchan->state eq 'normal'; } } else { diff --git a/perl/DXProt.pm b/perl/DXProt.pm index 59e7ca07..da2c1c51 100644 --- a/perl/DXProt.pm +++ b/perl/DXProt.pm @@ -1368,7 +1368,9 @@ sub send_local_config my @nodes; my @localnodes; my @remotenodes; - + + dbg('trace', 'DXProt::send_local_config'); + # send our nodes if ($self->{isolate}) { @localnodes = ( $main::routeroot ); diff --git a/perl/Filter.pm b/perl/Filter.pm index fbdb4f30..9b1b1d50 100644 --- a/perl/Filter.pm +++ b/perl/Filter.pm @@ -187,10 +187,15 @@ sub it my $filter; my @keys = sort $self->getfilkeys; my $key; + my $type = 'Dunno'; + my $asc = '?'; + my $r = @keys > 0 ? 0 : 1; foreach $key (@keys) { $filter = $self->{$key}; if ($filter->{reject} && exists $filter->{reject}->{code}) { + $type = 'reject'; + $asc = $filter->{reject}->{user}; if (&{$filter->{reject}->{code}}(\@_)) { $r = 0; last; @@ -199,6 +204,8 @@ sub it } } if ($filter->{accept} && exists $filter->{accept}->{code}) { + $type = 'accept'; + $asc = $filter->{accept}->{user}; if (&{$filter->{accept}->{code}}(\@_)) { $r = 1; last; @@ -211,6 +218,13 @@ sub it # hops are done differently (simply) my $hops = $self->{hops} if exists $self->{hops}; + if (isdbg('filter')) { + my $args = join '\',\'', @_; + my $true = $r ? "OK" : "REJ"; + my $sort = $self->{sort}; + $hops ||= "none"; + dbg('filter', "Filter: $type/$sort with $asc on '$args': $true hops: $hops"); + } return ($r, $hops); } -- 2.43.0