]> granicus.if.org Git - pdns/commitdiff
Restructure fix and conform to convention
authorJohan Jatko <armedguy@ludd.ltu.se>
Tue, 5 Sep 2017 16:22:16 +0000 (18:22 +0200)
committerJohan Jatko <armedguy@ludd.ltu.se>
Tue, 5 Sep 2017 16:22:16 +0000 (18:22 +0200)
pdns/zoneparser-tng.cc

index 7b3670df2fd8a951e2a362137aaf7c252f3abf76..54351e3301076d61056b3cd37de5acd90ddeb5b1 100644 (file)
@@ -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: