Browse Source

[2378] Fix ZoneLoader after merge

There were some small changes in the behaviour of MasterLoader as a
result of review, this is update do ZoneLoader and its tests to
incorporate that.
Michal 'vorner' Vaner 12 years ago
parent
commit
ce492ecf70
2 changed files with 5 additions and 3 deletions
  1. 0 2
      src/lib/datasrc/tests/zone_loader_unittest.cc
  2. 5 1
      src/lib/datasrc/zone_loader.cc

+ 0 - 2
src/lib/datasrc/tests/zone_loader_unittest.cc

@@ -327,8 +327,6 @@ TEST_F(ZoneLoaderTest, loadUnsignedIncremental) {
     // Not committed yet, we didn't complete the loading
     EXPECT_FALSE(destination_client_.commit_called_);
 
-    // This is unusual, but allowed. Check it doesn't do anything
-    loader.loadIncremental(0);
     EXPECT_EQ(10, destination_client_.rrsets_.size());
     EXPECT_FALSE(destination_client_.commit_called_);
 

+ 5 - 1
src/lib/datasrc/zone_loader.cc

@@ -110,7 +110,11 @@ ZoneLoader::loadIncremental(size_t limit) {
 
     if (iterator_ == ZoneIteratorPtr()) {
         assert(loader_.get() != NULL);
-        complete_ = loader_->loadIncremental(limit);
+        try {
+            complete_ = loader_->loadIncremental(limit);
+        } catch (const isc::dns::MasterLoaderError& e) {
+            isc_throw(MasterFileError, e.getMessage().c_str());
+        }
         if (complete_ && !loaded_ok_) {
             isc_throw(MasterFileError, "Error while loading master file");
         }