BIND 10 trac2377, updated. 3b1f845a12b4b30ae1cc4c1bdf2af8923995dfca [2377] Warn on unexpected EOF after error

BIND 10 source code commits bind10-changes at lists.isc.org
Mon Dec 10 14:13:14 UTC 2012


The branch, trac2377 has been updated
       via  3b1f845a12b4b30ae1cc4c1bdf2af8923995dfca (commit)
      from  c129951474788781d54007380769ff3eed0f15cf (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 3b1f845a12b4b30ae1cc4c1bdf2af8923995dfca
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date:   Mon Dec 10 14:44:48 2012 +0100

    [2377] Warn on unexpected EOF after error
    
    When there's an error, we expect there'll be EOLN somewhere, so we can
    recover. Warn in case there's EOF.

-----------------------------------------------------------------------

Summary of changes:
 src/lib/dns/master_loader.cc                |    3 +++
 src/lib/dns/tests/master_loader_unittest.cc |    5 ++---
 2 files changed, 5 insertions(+), 3 deletions(-)

-----------------------------------------------------------------------
diff --git a/src/lib/dns/master_loader.cc b/src/lib/dns/master_loader.cc
index 6fd40d8..f556dde 100644
--- a/src/lib/dns/master_loader.cc
+++ b/src/lib/dns/master_loader.cc
@@ -204,6 +204,9 @@ MasterLoader::MasterLoaderImpl::loadIncremental(size_t count_limit) {
                 const MasterToken& token(lexer_.getNextToken());
                 switch (token.getType()) {
                     case MasterToken::END_OF_FILE:
+                        callbacks_.warning(lexer_.getSourceName(),
+                                           lexer_.getSourceLine(),
+                                           "Unexpected end ond of file");
                         // TODO: Try pop in case this is not the only
                         // source
                         return (true);
diff --git a/src/lib/dns/tests/master_loader_unittest.cc b/src/lib/dns/tests/master_loader_unittest.cc
index 184ab67..74baa3b 100644
--- a/src/lib/dns/tests/master_loader_unittest.cc
+++ b/src/lib/dns/tests/master_loader_unittest.cc
@@ -282,9 +282,8 @@ TEST_F(MasterLoaderTest, brokenZone) {
             EXPECT_NO_THROW(loader_->load());
             EXPECT_FALSE(loader_->loadedSucessfully());
             EXPECT_EQ(1, errors_.size());
-            // FIXME: The invalid rdata generates a warning.
-            // And we may want to generate warning ourself here too.
-            // EXPECT_TRUE(warnings_.empty());
+            // The unexpected EOF warning
+            EXPECT_EQ(1, warnings_.size());
             checkRR("example.org", RRType::SOA(), "ns1.example.org. "
                     "admin.example.org. 1234 3600 1800 2419200 7200");
             EXPECT_TRUE(rrsets_.empty());



More information about the bind10-changes mailing list