2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 13:37:55 +00:00

[2378] Simplify the loadIncremental code

Some of the code can be shared between the variants, saving some code.
This commit is contained in:
Michal 'vorner' Vaner
2012-12-07 14:09:05 +01:00
parent af1da46eef
commit 27033b59dc

View File

@@ -110,26 +110,18 @@ ZoneLoader::loadIncremental(size_t limit) {
if (iterator_ == ZoneIteratorPtr()) { if (iterator_ == ZoneIteratorPtr()) {
assert(loader_.get() != NULL); assert(loader_.get() != NULL);
if (loader_->loadIncremental(limit)) { complete_ = loader_->loadIncremental(limit);
complete_ = true; if (complete_ && !loaded_ok_) {
if (!loaded_ok_) {
isc_throw(MasterFileError, "Error while loading master file"); isc_throw(MasterFileError, "Error while loading master file");
}
} else { } else {
complete_ = copyRRsets(updater_, iterator_, limit);
}
if (complete_) {
updater_->commit(); updater_->commit();
} }
return (true); return (complete_);
} else {
return (false);
}
} else {
if (copyRRsets(updater_, iterator_, limit)) {
updater_->commit();
complete_ = true;
return (true);
} else {
return (false);
}
}
} }
} // end namespace datasrc } // end namespace datasrc