From: Johan Jatko Date: Tue, 5 Sep 2017 16:22:16 +0000 (+0200) Subject: Restructure fix and conform to convention X-Git-Tag: rec-4.1.0-rc1~28^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f067a158e6741bc14c5dbc25df81e0b2f8630a0;p=pdns Restructure fix and conform to convention --- diff --git a/pdns/zoneparser-tng.cc b/pdns/zoneparser-tng.cc index 7b3670df2..54351e330 100644 --- a/pdns/zoneparser-tng.cc +++ b/pdns/zoneparser-tng.cc @@ -468,23 +468,22 @@ bool ZoneParserTNG::get(DNSResourceRecord& rr, std::string* comment) } break; case QType::AFSDB: - try { - stringtok(recparts, rr.content); - if(recparts.size() == 2) - { + stringtok(recparts, rr.content); + if(recparts.size() == 2) { + try { recparts[1]=toCanonic(d_zonename, recparts[1]).toStringRootDot(); - } else { - throw PDNSException("AFSDB record for "+rr.qname.toString()+" invalid"); + } catch (std::exception &e) { + throw PDNSException("Error in record '" + rr.qname.toString() + " " + rr.qtype.getName() + "': " + e.what()); } - rr.content.clear(); - for(string::size_type n = 0; n < recparts.size(); ++n) { - if(n) - rr.content.append(1,' '); + } else { + throw PDNSException("AFSDB record for "+rr.qname.toString()+" invalid"); + } + rr.content.clear(); + for(string::size_type n = 0; n < recparts.size(); ++n) { + if(n) + rr.content.append(1,' '); - rr.content+=recparts[n]; - } - } catch (std::exception &e) { - throw PDNSException("Error in record '" + rr.qname.toString() + " " + rr.qtype.getName() + "': " + e.what()); + rr.content+=recparts[n]; } break; case QType::SOA: