Parcourir la source

[2387] Allow comments at the end of DS like string data

Mukund Sivaraman il y a 12 ans
Parent
commit
00d53a3241
1 fichiers modifiés avec 8 ajouts et 1 suppressions
  1. 8 1
      src/lib/dns/rdata/generic/detail/ds_like.h

+ 8 - 1
src/lib/dns/rdata/generic/detail/ds_like.h

@@ -79,7 +79,14 @@ public:
 
             constructFromLexer(lexer);
 
-            if (lexer.getNextToken().getType() != MasterToken::END_OF_FILE) {
+            for (MasterToken::Type token_type = lexer.getNextToken().getType();
+                 token_type != MasterToken::END_OF_FILE;
+                 token_type = lexer.getNextToken().getType())
+            {
+                if (token_type == MasterToken::END_OF_LINE) {
+                    continue;
+                }
+
                 isc_throw(InvalidRdataText,
                           "Extra input text for " << RRType(typeCode) << ": "
                           << ds_str);