- Timestamp:
- 06/28/17 18:20:30 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r764 r767 1409 1409 if (!$iplist) { 1410 1410 # not fatal since we do the lookup on export as well 1411 return ('WARN', 1412 join("\n", $errstr, "No cached data and no live DNS data for ALIAS target ${$args{val}}; record may be SKIPPED on export!") ); 1411 $warnmsg = "No cached data and no live DNS data for ALIAS target ${$args{val}}; record may be SKIPPED on export!"; 1413 1412 } 1414 1413 } 1415 1414 1416 1415 # munge the insert/update fieldlist and data array 1417 if ($iplist ne $liveips) { 1416 # note we always force this; if the target has changed the cached data is almost certainly invalid anyway 1417 if ($liveips && ($iplist ne $liveips)) { 1418 1418 ${$args{fields}} .= "auxdata,"; 1419 1419 push @{$args{vallist}}, $liveips; 1420 1420 } 1421 1421 1422 return ('WARN', $warnmsg) if $warnmsg;1422 return ('WARN', join("\n", $errstr, $warnmsg) ) if $warnmsg; 1423 1423 1424 1424 return ('OK','OK'); … … 1438 1438 my $reply = $res->query($target); 1439 1439 1440 my $liveips ;1440 my $liveips = ''; 1441 1441 if ($reply) { 1442 1442 # default to a one-hour TTL, which should be variously modified down the chain. Arguably this could … … 1453 1453 $minttl = 60 if $minttl < 60; 1454 1454 # we don't need this to be perfectly correct IP address order, just consistent. 1455 $liveips = "$minttl:".join(':', sort(@newlist)); 1455 $liveips = "$minttl:".join(':', sort(@newlist)) if @newlist; 1456 #fixme: should it be a formal error case if there are no A records returned? 1456 1457 } else { 1457 1458 $errstr = "Lookup failure retrieving ALIAS IP list: ".$res->errorstring; … … 6760 6761 6761 6762 my ($iplist) = $self->{dbh}->selectrow_array("SELECT auxdata FROM records WHERE record_id = ?", undef, $recid); 6763 $iplist = '' if !$iplist; 6762 6764 6763 6765 # shared target-name-to-IP converter 6764 6766 my $liveips = $self->_grab_65300($recid, $val); 6765 if ($iplist ne $liveips) { 6767 # only update the cache if the live lookup actually returned data 6768 if ($liveips && ($iplist ne $liveips)) { 6766 6769 $self->{dbh}->do("UPDATE records SET auxdata = ? WHERE record_id = ?", undef, $liveips, $recid); 6767 6770 $iplist = $liveips;
Note:
See TracChangeset
for help on using the changeset viewer.