]> 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:41:38 +0000 (18:41 +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 16d27cddd03f051cad1feaa3dc7e0b37ac008644..5cccfc491d5bba66a0431986fe3cc38f4c1a5479 100644 (file)
@@ -72,7 +72,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 b0b723ce00f161b0464a7929507eb853ca6da513..25d742250a6572037ee6f4589a2cf54a4bd4a53f 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 5e40d3c2afa5bdfb86e9a8b3aaf302a551f3ebd6..9e7a03a1da59af184231ff4d675f46aab5c641ef 100644 (file)
@@ -484,7 +484,7 @@ sub new_client {
        $sock->start;
        $conn->{peerhost} = $handle->peerhost;
        $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 2d04f411e14973c47de9712e53a032e516d79809..0761f07d0522f865ad10d4c950df4d12033f7f02 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 a4185caa5323fb249309f3609a002f4388b5c76a..02e86a770ee7a6e3414d6b9f2280cc183d961289 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]";