Changeset 70 for trunk


Ignore:
Timestamp:
07/19/18 17:57:31 (6 years ago)
Author:
Kris Deugau
Message:

/trunk/dnsbl

Further tweaks from production

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/DNSBL.pm

    r69 r70  
    205205  my $self = shift;
    206206  my $rep = shift;
    207   my $exclude = shift;
     207  my $exclude = shift || 'n';
    208208  my $sth;
    209209  my $rows = 0;
     
    227227      $sth = $dbh->prepare("SELECT block FROM blocks WHERE block >> ?");
    228228      $sth->execute($rep);
    229       my $updsth = $dbh->prepare("UPDATE blocks SET ipcount=(SELECT count(*) FROM iplist WHERE ip << ? AND exclude='n') WHERE block=?");
     229      my $updsth = $dbh->prepare("UPDATE blocks SET ipcount=(".
     230        "SELECT count(*) FROM iplist i JOIN blocks b ON b.block=i.parent WHERE i.ip << ? AND i.exclude='n' AND b.exclude='n'".
     231        ") WHERE block=?");
    230232      while (my ($block) = $sth->fetchrow_array) {
    231233        $updsth->execute($block,$block);
Note: See TracChangeset for help on using the changeset viewer.