Changeset 678


Ignore:
Timestamp:
01/22/15 18:27:21 (10 years ago)
Author:
Kris Deugau
Message:

/trunk

Fixes for edge-case updates via RPC:

  • Replace call to $dnsdb->updateRec with rpc_UpdateRec in addOrUpdateRevRec to match the way arguments were being passed, and for consistency with the rest of the internal subcalls.
  • Accept CIDR addresses, not just bare IPs, in updateRevSet; RPC is inexplicably slow so allowing batching of similar or mostly similar operations could speed things up a lot
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dns-rpc.cgi

    r676 r678  
    590590          # types are nominally impossible here.
    591591          next unless $rec->{type} == 65282 || $rec->{type} == 65283 || $rec->{type} == 65284;
    592           $dnsdb->updateRec(defrec =>'n', revrec => 'y', id => $rec->{record_id},
     592          rpc_updateRec(defrec => 'n', revrec => 'y', id => $rec->{record_id},
    593593            parent_id => $zdata->{rdns_id}, %args);
    594594          last; # only do one record.
     
    610610  # loop over passed IP/hostname pairs
    611611  foreach my $key (keys %args) {
    612     next unless $key =~ /^host_([\d.]+|[\da-f:]+)$/;
     612    next unless $key =~ m{^host_((?:[\d.]+|[\da-f:]+)(?:/\d+)?)$};
    613613    my $ip = $1;
    614614    push @ret, addOrUpdateRevRec(cidr => $ip, name => $args{$key}, %args);
Note: See TracChangeset for help on using the changeset viewer.