Changeset 11 for trunk/dnsbl/DNSBL.pm


Ignore:
Timestamp:
01/06/10 13:09:31 (14 years ago)
Author:
Kris Deugau
Message:

/trunk/dnsbl

Report errors adding a netblock (commonly a range in WHOIS that's not

a single CIDR block)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dnsbl/DNSBL.pm

    r10 r11  
    206206  my $block = new NetAddr::IP "$blockin";       # need this to clean up messes like ranges.  sigh.
    207207
     208  return "$blockin not a single CIDR range" if !$block;
     209
    208210  local $dbh->{AutoCommit} = 1; # force autocommit
    209211
    210212  my $sth = $dbh->prepare("INSERT INTO blocks (block,orgid,level) VALUES (?,?,?)");
    211213  $sth->execute("$block",$orgid,$level);
     214  return $sth->errstr if $sth->err;
    212215  # nb: no need to return anything, since the CIDR block is the key
    213216}
Note: See TracChangeset for help on using the changeset viewer.