Changeset 70
- Timestamp:
- 07/19/18 17:57:31 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/dnsbl/DNSBL.pm
r69 r70 205 205 my $self = shift; 206 206 my $rep = shift; 207 my $exclude = shift ;207 my $exclude = shift || 'n'; 208 208 my $sth; 209 209 my $rows = 0; … … 227 227 $sth = $dbh->prepare("SELECT block FROM blocks WHERE block >> ?"); 228 228 $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=?"); 230 232 while (my ($block) = $sth->fetchrow_array) { 231 233 $updsth->execute($block,$block);
Note:
See TracChangeset
for help on using the changeset viewer.