]> dxcluster.net Git - spider.git/commitdiff
limit the no of spots stored for a search
authorDirk Koopman <djk@tobit.co.uk>
Sat, 23 May 2020 17:37:49 +0000 (18:37 +0100)
committerDirk Koopman <djk@tobit.co.uk>
Sat, 23 May 2020 17:37:49 +0000 (18:37 +0100)
This is to cope with people that suck skimmer spots and end up
with 100Mb files to read. But it does rely on the hint getting
most of the candidates with not more than 2 false positives.

perl/DXCron.pm
perl/DXDebug.pm
perl/DXLogPrint.pm
perl/Msg.pm
perl/Spot.pm
perl/cluster.pl

index b0d4b1c6dc6609c158cd3568cd5ce2e168f9ce9b..12192891de1bba6939b8ade706e1feed6ca97940 100644 (file)
@@ -71,7 +71,7 @@ sub cread
                my ($min, $hour, $mday, $month, $wday, $cmd) = /^\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(.+)$/o;
                next unless defined $min;
                my $ref = bless {};
-               my $err;
+               my $err = '';
 
                if (defined $min && defined $hour && defined $cmd) { # it isn't all of them, but should be enough to tell if this is a real line
                        $err .= parse($ref, 'min', $min, 0, 60);
index f5c1640196d459251235cd328ebecf40396a6f07..c195fe2de01763f0025e655ab615dcd26799fe8e 100644 (file)
@@ -85,7 +85,7 @@ if (!defined $DB::VERSION) {
 
 my $_isdbg;                                            # current dbg level we are processing
 
-sub dbg($)
+sub dbg
 {
        return unless $fp;
        my $t = time; 
@@ -93,11 +93,11 @@ sub dbg($)
                my $r = $_;
                chomp $r;
                my @l = split /\n/, $r;
-               for (@l) {
-                       s/([\x00-\x08\x0B-\x1f\x7f-\xff])/uc sprintf("%%%02x",ord($1))/eg;
-                       print "$_\n" if defined \*STDOUT && !$no_stdout;
-                       my $tag = $_isdbg ? "($_isdbg) " : '';
-                       my $str = "$t^$tag$_";
+               foreach my $l (@l) {
+                       $l =~ s/([\x00-\x08\x0B-\x1f\x7f-\xff])/sprintf("%%%02X",ord($1))/eg;
+                       print "$l\n" if defined \*STDOUT && !$no_stdout;
+                       my $tag = $_isdbg ? "($_isdbg) " : '(*) ';
+                       my $str = "$t^$tag$l";
                        &$callback($str) if $callback;
                        if ($dbgringlth) {
                                shift @dbgring while (@dbgring > $dbgringlth);
index 9564ae690b87d84817f32c1cea06e74cab5a826f..9bb51f20a579a2e34ecf6220e5690ba7cd9e420a 100644 (file)
@@ -20,6 +20,8 @@ use Julian;
 
 our $readback = `which tac`;
 chomp $readback;
+undef $readback;                               # yet another reason not to use the cloud!
 
 use strict;
 
index 9ea2bc10c9aaad10a3f9e8ca0d96b6d95b522b69..9b7ce76fd9e32091f9b7b858f252b6f4185e7fab 100644 (file)
@@ -484,7 +484,7 @@ sub new_client {
        $sock->start;
        $conn->{peerhost} = $handle->peerhost || 'unknown';
        $conn->{peerhost} =~ s|^::ffff:||; # chop off leading pseudo IPV6 stuff on dual stack listeners
-       $conn->{peerport} = $handle->peerport;
+       $conn->{peerport} = $handle->peerport || 0;
        dbg((ref $conn) . " accept $conn->{cnum} from $conn->{peerhost}:$conn->{peerport}") if isdbg('conn') || isdbg('connect');
        my ($rproc, $eproc) = &{$server_conn->{rproc}} ($conn, $conn->{peerhost}, $conn->{peerport});
        $conn->{sort} = 'Incoming';
index 74b3f77319decf08c9f004a471d7cc34b46161e4..840913d1cd9184e90683e7b70d611f782fd84c7e 100644 (file)
@@ -307,6 +307,7 @@ sub search
                                   my \@s = split /\\^/;
                    $checkfilter;
                    push \@spots, \\\@s;
+                   shift \@spots if \@spots > $to + 2; 
                           }
                           my \$c;
                           my \$ref;
index 3e57deb6dca15f9acebf0bd847f96228a88dbb8a..e13fb03493dea1093bb0c1e2844005fad9ed7078 100755 (executable)
@@ -513,8 +513,8 @@ sub setup_start
                                if ($desc) {
                                        my ($v, $s, $b, $g) = $desc =~ /^([\d.]+)(?:\.(\d+))?-(\d+)-g([0-9a-f]+)/;
                                        $s ||= '';
-                                       dbg("Git: $desc");
-                                       dbg("Git: V=$v S=$s B=$b g=$g");
+                                       dbg("Git: $desc") if isdbg('git');
+                                       dbg("Git: V=$v S=$s B=$b g=$g") if isdbg('git');
                                        $version = $v;
                                        $build = $b || 0;
                                        $gitversion = "$g\[r]";