X-Git-Url: http://www.dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2FSpot.pm;h=72a898079617c35a7f73fabef374475b6ed895b5;hb=d4b94aba599c706c4fcb61aa206b84e166e8b690;hp=4b0e7c72929ba3822afe2bbc0c3faebc39b709ed;hpb=bcf2892aa7f3c9957ee61365a6e032dd93044834;p=spider.git diff --git a/perl/Spot.pm b/perl/Spot.pm index 4b0e7c72..72a89807 100644 --- a/perl/Spot.pm +++ b/perl/Spot.pm @@ -153,7 +153,7 @@ sub prepare sub add { - my $buf = join("\^", @_[0..7]); + my $buf = join("\^", @_); $fp->writeunix($_[2], $buf); $totalspots++; if ($_[0] <= 30000) { @@ -194,7 +194,7 @@ sub add sub search { - my ($expr, $dayfrom, $dayto, $from, $to, $hint) = @_; + my ($expr, $dayfrom, $dayto, $from, $to, $hint, $dxchan) = @_; my $eval; my @out; my $ref; @@ -233,6 +233,22 @@ sub search for (\$c = \$#spots; \$c >= 0; \$c--) { \$ref = \$spots[\$c]; if ($expr) { + if (\$dxchan && \$dxchan->{inspotsfilter}) { + if (\@\$ref < 9) { + my \@dxcc = Prefix::cty_data(\$ref->[1]); + if (\@dxcc) { + pop \@dxcc; + push \@\$ref, \@dxcc; + } + \@dxcc = Prefix::cty_data(\$ref->[4]); + if (\@dxcc) { + pop \@dxcc; + push \@\$ref, \@dxcc; + } + } + my (\$filter, \$hops) = \$dxchan->{inspotsfilter}->it(\@\$ref); + next unless (\$filter); + } \$count++; next if \$count < \$from; # wait until from push(\@out, \$ref); @@ -240,6 +256,9 @@ sub search } } ); + + dbg("Spot eval: $eval") if isdbg('searcheval'); + $fp->close; # close any open files