X-Git-Url: http://dxcluster.net/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FFilter.pm;h=a422b014a926d31eb2779cbd9a587a4ff695a686;hb=b1f9b4650ed8fdeb1e03834f076f3040ce65776a;hp=12caeef398d21c20b95d1f87e43b48d9c1bdd11d;hpb=86d0e8cc034db0b0d23afc09b6f596c38a57885d;p=spider.git diff --git a/perl/Filter.pm b/perl/Filter.pm index 12caeef3..a422b014 100644 --- a/perl/Filter.pm +++ b/perl/Filter.pm @@ -231,13 +231,15 @@ sub it my $hops = $self->{hops} if exists $self->{hops}; if (isdbg('filter')) { + my $call = $self->{name}; my $args = join '\',\'', map {defined $_ ? $_ : 'undef'} (ref $_[0] ? @{$_[0]} : @_); my $true = $r ? "OK " : "REJ"; my $sort = $self->{sort}; my $dir = $self->{name} =~ /^in_/i ? "IN " : "OUT"; - + + $call =~ s/\.PL$//i; my $h = $hops || ''; - dbg("$true $dir: $type/$sort with $asc on '$args' $h") if isdbg('filter'); + dbg("Filter: $call $true $dir: $type/$sort with '$asc' on '$args' $h") if isdbg('filter'); } return ($r, $hops); } @@ -370,7 +372,7 @@ sub parse my $filter; my ($flag, $call); my $s; - my $user; + my $user = ''; # check the line for non legal characters dbg("Filter::parse line: '$line'") if isdbg('filter'); @@ -548,11 +550,13 @@ sub parse } } - # tidy up the user string - $user =~ s/\&\&/ and /g; - $user =~ s/\|\|/ or /g; - $user =~ s/\!/ not /g; - $user =~ s/\s+/ /g; + # tidy up the user string (why I have to stick in an if statement when I have initialised it I have no idea! 5.28 bug? + if ($user) { + $user =~ s/\&\&/ and /g; + $user =~ s/\|\|/ or /g; + $user =~ s/\!/ not /g; + $user =~ s/\s+/ /g; + } return (0, $filter, $fno, $user, $s); } @@ -581,7 +585,8 @@ sub cmd $r = $filter->write; return (1,$r) if $r; - + + $filter->install(1); # 'delete' $filter->install; return (0, $filter, $fno);