Changeset 24 for trunk/dnsbl/DNSBL.pm


Ignore:
Timestamp:
09/02/10 17:52:48 (14 years ago)
Author:
Kris Deugau
Message:

/trunk/dnsbl

Add code to override autolist thresholds from database table

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/DNSBL.pm

    r23 r24  
    4444# probably needs some tuning;  even 7 hits in a /24 is a pretty small percentage
    4545# number of IPs in a block of the given masklength needed to have that block automatically listed
     46# defaults: (overridden by entries in db:autolist)
    4647our %autolist = (
    4748        31 => 1,
     
    121122        })
    122123        or die "database inaccessible: ".$DBI::errstr;
     124  my $sth = $dbh->prepare("SELECT masklen,ipcount FROM autolist");
     125  $sth->execute;
     126  while (my ($masklen,$ipcount) = $sth->fetchrow_array) {
     127    $autolist{$masklen} = $ipcount;
     128  }
    123129  return $dbh;
    124130}
Note: See TracChangeset for help on using the changeset viewer.