- Timestamp:
- 07/15/11 17:45:46 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/DNSDB.pm
r104 r105 1403 1403 # processing depending on the record. le sigh. 1404 1404 1405 ##fixme: what record types other than TXT can/will have >255-byte payloads? 1406 1405 1407 if ($type eq 'A') { 1406 1408 push @vallist, $rr->address; … … 1418 1420 $soaflag = 1; 1419 1421 } elsif ($type eq 'PTR') { 1422 push @vallist, $rr->ptrdname; 1420 1423 # hmm. PTR records should not be in forward zones. 1421 1424 } elsif ($type eq 'MX') { … … 1427 1430 ##fixme: Net::DNS docs say this should be deprecated for rdatastr() or char_str_list(), 1428 1431 ## but don't really seem enthusiastic about it. 1429 push @vallist, $rr->txtdata; 1432 my $rrdata = $rr->txtdata; 1433 if (length($rrdata) > 100 ) { 1434 # extralong records get an entry in a separate table. 1435 $dbh->do("INSERT INTO longrecs (recdata) VALUES (?)", undef, ($rrdata) ); 1436 my ($longid) = $dbh->selectrow_array("SELECT longrec_id FROM longrecs WHERE recdata=?", undef, ($rrdata) ); 1437 $sql .= ",longrec_id"; 1438 $vallen .= ",?"; 1439 push @vallist, ''; 1440 push @vallist, $longid; 1441 } else { 1442 push @vallist, $rrdata; 1443 } 1430 1444 } elsif ($type eq 'SPF') { 1431 1445 ##fixme: and the same caveat here, since it is apparently a clone of ::TXT 1432 push @vallist, $rr->txtdata; 1446 my $rrdata = $rr->txtdata; 1447 if (length($rrdata) > 100 ) { 1448 # extralong records get an entry in a separate table. 1449 $dbh->do("INSERT INTO longrecs (recdata) VALUES (?)", undef, ($rrdata) ); 1450 my ($longid) = $dbh->selectrow_array("SELECT longrec_id FROM longrecs WHERE recdata=?", undef, ($rrdata) ); 1451 $sql .= ",longrec_id"; 1452 $vallen .= ",?"; 1453 push @vallist, ''; 1454 push @vallist, $longid; 1455 } else { 1456 push @vallist, $rrdata; 1457 } 1433 1458 } elsif ($type eq 'AAAA') { 1434 1459 push @vallist, $rr->address; … … 1444 1469 push @vallist, ($rr->flags.":".$rr->protocol.":".$rr->algorithm.":".$rr->key.":".$rr->keytag.":".$rr->privatekeyname); 1445 1470 } else { 1446 push @vallist, $rr->rdatastr; 1471 my $rrdata = $rr->rdatastr; 1472 if (length($rrdata) > 100 ) { 1473 # extralong records get an entry in a separate table. 1474 $dbh->do("INSERT INTO longrecs (recdata) VALUES (?)", undef, ($rrdata) ); 1475 my ($longid) = $dbh->selectrow_array("SELECT longrec_id FROM longrecs WHERE recdata=?", undef, ($rrdata) ); 1476 $sql .= ",longrec_id"; 1477 $vallen .= ",?"; 1478 push @vallist, ''; 1479 push @vallist, $longid; 1480 } else { 1481 push @vallist, $rrdata; 1482 } 1447 1483 # Finding a different record type is not fatal.... just problematic. 1448 1484 # We may not be able to export it correctly.
Note:
See TracChangeset
for help on using the changeset viewer.