BIND 10 trac2376, updated. 487768796e6c8941c4b2399546de8b4161c06f63 [2376] Implement the LoaderContext
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Nov 7 12:53:01 UTC 2012
The branch, trac2376 has been updated
via 487768796e6c8941c4b2399546de8b4161c06f63 (commit)
via 9bf97db7a4adcdd0da29c2a411f439f7ec0da417 (commit)
from 15bd8b64fbd62d313b6d91ae5b70ff548a7cce2b (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 487768796e6c8941c4b2399546de8b4161c06f63
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Nov 7 13:50:38 2012 +0100
[2376] Implement the LoaderContext
commit 9bf97db7a4adcdd0da29c2a411f439f7ec0da417
Author: Michal 'vorner' Vaner <michal.vaner at nic.cz>
Date: Wed Nov 7 13:31:47 2012 +0100
[2376] Empty implementation of the LoaderContext methods
So the tests compile and properly fail.
-----------------------------------------------------------------------
Summary of changes:
src/lib/datasrc/datasrc_messages.mes | 12 ++++++++++++
src/lib/datasrc/loader_context.cc | 36 ++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+)
-----------------------------------------------------------------------
diff --git a/src/lib/datasrc/datasrc_messages.mes b/src/lib/datasrc/datasrc_messages.mes
index 94b4d42..9ba2d9c 100644
--- a/src/lib/datasrc/datasrc_messages.mes
+++ b/src/lib/datasrc/datasrc_messages.mes
@@ -305,6 +305,18 @@ Therefore, the zone will not be available for this process. If this is
a problem, you should move the zone to some database backend (sqlite3, for
example) and use it from there.
+% DATASRC_LOAD_CONTEXT_ERROR In master file '%1' on line '%2': '%3'
+There's an error in the given master file. The zone won't be loaded for
+this reason. Parsing might follow, so you might get further errors and
+warnings to fix everything at once. But in case the error is serious enough,
+the parser might just give up or get confused and generate false errors
+afterwards.
+
+% DATASRC_LOAD_CONTEXT_WARN In master file '%1' on line '%2': '%3'
+There's something suspicious in the master file. This is a warning only.
+It may be a problem or it may be harmless, but it should be checked.
+This problem does not stop the zone from being loaded.
+
% DATASRC_MASTERLOAD_ERROR %1
An error was found in the zone data for a MasterFiles zone. The zone
is not loaded. The specific error is shown in the message, and should
diff --git a/src/lib/datasrc/loader_context.cc b/src/lib/datasrc/loader_context.cc
index 5796271..bce0039 100644
--- a/src/lib/datasrc/loader_context.cc
+++ b/src/lib/datasrc/loader_context.cc
@@ -13,9 +13,45 @@
// PERFORMANCE OF THIS SOFTWARE.
#include <datasrc/loader_context.h>
+#include <datasrc/zone.h>
+#include <datasrc/logger.h>
+
+#include <boost/bind.hpp>
namespace isc {
namespace datasrc {
+LoaderContext::LoaderContext(ZoneUpdater& updater) :
+ updater_(updater),
+ ok_(true)
+{
+ callbacks_.error = boost::bind(&LoaderContext::handleError, this, _1, _2,
+ _3, _4);
+ callbacks_.warning = boost::bind(&LoaderContext::handleWarning, this, _1,
+ _2, _3, _4);
+}
+
+void
+LoaderContext::addRRset(const isc::dns::RRsetPtr& rrset) {
+ updater_.addRRset(*rrset);
+}
+
+void
+LoaderContext::handleWarning(const std::string& source, size_t line, size_t,
+ const std::string& reason)
+{
+ LOG_WARN(logger, DATASRC_LOAD_CONTEXT_WARN).arg(source).arg(line).
+ arg(reason);
+}
+
+void
+LoaderContext::handleError(const std::string& source, size_t line, size_t,
+ const std::string& reason)
+{
+ LOG_ERROR(logger, DATASRC_LOAD_CONTEXT_ERROR).arg(source).arg(line).
+ arg(reason);
+ ok_ = false;
+}
+
}
}
More information about the bind10-changes
mailing list