release candidate
[spider.git] / perl / DXCIDR.pm
index 88a26d5c552631e4b66c173eb0c3262400e17d0d..fdade7fc8989bae6d17fad741ff636604c0d2938 100644 (file)
@@ -202,10 +202,23 @@ sub reload
 {
        new();
 
-       my $count = _load('base');
-       $count += _load('local');
-
-       LogDbg('DXProt', "DXCIDR::reload $count ip addresses found (IPV4: $count4 IPV6: $count6)" );
+       my $count = 0;
+       my $files = 0;
+
+       LogDbg('DXProt', "DXCIDR::reload reload database" );
+
+       my $dir;
+       opendir($dir, $main::local_data);
+       while (my $fn = readdir $dir) {
+               next unless my ($suffix) = $fn =~ /^badip\.(\w+)$/;
+               my $c = _load($suffix);
+               LogDbg('DXProt', "DXCIDR::reload: $fn read containing $c ip addresses" );
+               $count += $c;
+               $files++;
+       }
+       closedir $dir;
+       
+       LogDbg('DXProt', "DXCIDR::reload $count ip addresses found (IPV4: $count4 IPV6: $count6) in $files badip files" );
 
        return $count;
 }