Browse Source

[2431] Add comments

Mukund Sivaraman 12 years ago
parent
commit
1a7c1e3d9a
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/lib/dns/master_loader.cc

+ 6 - 1
src/lib/dns/master_loader.cc

@@ -152,7 +152,8 @@ private:
         // [<class>] [<TTL>] <type> <RDATA>
         MasterToken rrparam_token = lexer_.getNextToken(MasterToken::STRING);
 
-        // Try TTL
+        // named-signzone outputs TTL first, so try parsing it in order
+        // first.
         if (setCurrentTTL(rrparam_token.getString())) {
             explicit_ttl = true;
             rrparam_token = lexer_.getNextToken(MasterToken::STRING);
@@ -170,11 +171,14 @@ private:
             rrclass.reset(new RRClass(zone_class_));
         }
 
+        // If we couldn't parse TTL earlier in the stream (above), try
+        // again at current location.
         if (!explicit_ttl && rrclass &&
             setCurrentTTL(rrparam_token.getString())) {
             explicit_ttl = true;
             rrparam_token = lexer_.getNextToken(MasterToken::STRING);
         }
+
         if (*rrclass != zone_class_) {
             // It doesn't really matter much what type of exception
             // we throw, we catch it just below.
@@ -182,6 +186,7 @@ private:
                       "vs. " << zone_class_);
         }
 
+        // Return the current string token's value as the RRType.
         return (RRType(rrparam_token.getString()));
     }