BIND 10 trac736, updated. 542a15d604018ea73a5a28f26b30b92fb668e399 [trac736] last TODO (log message) and removed a few debug statements
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Jun 7 07:17:16 UTC 2011
The branch, trac736 has been updated
via 542a15d604018ea73a5a28f26b30b92fb668e399 (commit)
from 795329663bef70bf69fddd14267daff57abfadd4 (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 542a15d604018ea73a5a28f26b30b92fb668e399
Author: Jelte Jansen <jelte at isc.org>
Date: Tue Jun 7 09:16:54 2011 +0200
[trac736] last TODO (log message) and removed a few debug statements
-----------------------------------------------------------------------
Summary of changes:
src/lib/config/ccsession.cc | 6 +++---
src/lib/config/config_data.cc | 10 +++-------
src/lib/config/configdef.mes | 7 +++++++
3 files changed, 13 insertions(+), 10 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/config/ccsession.cc b/src/lib/config/ccsession.cc
index 43a7908..035735e 100644
--- a/src/lib/config/ccsession.cc
+++ b/src/lib/config/ccsession.cc
@@ -481,9 +481,9 @@ ModuleCCSession::checkCommand() {
LOG_ERROR(config_logger, CONFIG_CCSESSION_MSG).arg(re.what());
} catch (const std::exception& stde) {
// No matter what unexpected error happens, we do not want
- // to crash because of an incoming event
- // TODO: MSG
- LOG_ERROR(config_logger, CONFIG_CCSESSION_MSG).arg(stde.what());
+ // to crash because of an incoming event, so we log the
+ // exception and continue to run
+ LOG_ERROR(config_logger, CONFIG_CCSESSION_MSG_INTERNAL).arg(stde.what());
}
if (!isNull(answer)) {
session_.reply(routing, answer);
diff --git a/src/lib/config/config_data.cc b/src/lib/config/config_data.cc
index 211877d..efa913c 100644
--- a/src/lib/config/config_data.cc
+++ b/src/lib/config/config_data.cc
@@ -34,10 +34,8 @@ ConstElementPtr findListOrMapSubSpec(ConstElementPtr spec_part) {
(spec_part->contains("list_item_spec") ||
spec_part->contains("map_item_spec"))) {
if (spec_part->contains("list_item_spec")) {
- std::cout << "[XX] yup, list" << std::endl;
spec_part = spec_part->get("list_item_spec");
} else {
- std::cout << "[XX] yup, map" << std::endl;
spec_part = spec_part->get("map_item_spec");
}
}
@@ -56,7 +54,6 @@ ConstElementPtr findItemInSpecList(ConstElementPtr spec_part,
const std::string& id_full)
{
bool found = false;
- std::cout << "[XX] find item in list: " << spec_part->str() << std::endl;
BOOST_FOREACH(ConstElementPtr list_el, spec_part->listValue()) {
if (list_el->getType() == Element::map &&
list_el->contains("item_name") &&
@@ -101,7 +98,6 @@ find_spec_part(ConstElementPtr spec, const std::string& identifier) {
size_t sep = id.find('/');
while(sep != std::string::npos) {
std::string part = id.substr(0, sep);
- std::cout << "[XX] NEXT IS: " << part << std::endl;
if (spec_part->getType() == Element::list) {
spec_part = findItemInSpecList(spec_part, part, identifier);
@@ -109,7 +105,6 @@ find_spec_part(ConstElementPtr spec, const std::string& identifier) {
isc_throw(DataNotFoundError,
"Not a list of spec items: " + spec_part->str());
}
- std::cout << "[XX] FOUND: " << part << std::endl;
id = id.substr(sep + 1);
sep = id.find("/");
@@ -117,11 +112,9 @@ find_spec_part(ConstElementPtr spec, const std::string& identifier) {
// by the identifier, we want to automatically traverse list
// and map specifications
if (id != "" && id != "/") {
- std::cout << "[XX] try sublist " << id << std::endl;
spec_part = findListOrMapSubSpec(spec_part);
}
}
- std::cout << "[XX] LAST: " << id << std::endl;
if (id != "" && id != "/") {
if (spec_part->getType() == Element::list) {
spec_part = findItemInSpecList(spec_part, id, identifier);
@@ -131,6 +124,9 @@ find_spec_part(ConstElementPtr spec, const std::string& identifier) {
spec_part->get("map_item_spec"),
id, identifier);
} else {
+ // Either we already have the element we are looking
+ // for, or we are trying to reach something that does
+ // not exist (i.e. the code does not match the spec)
if (!spec_part->contains("item_name") ||
spec_part->get("item_name")->stringValue() != id) {
isc_throw(DataNotFoundError, "Element above " + id +
diff --git a/src/lib/config/configdef.mes b/src/lib/config/configdef.mes
index 4c3c991..be39073 100644
--- a/src/lib/config/configdef.mes
+++ b/src/lib/config/configdef.mes
@@ -48,3 +48,10 @@ channel. The message does not appear to be a valid command, and is
missing a required element or contains an unknown data format. This
most likely means that another BIND10 module is sending a bad message.
The message itself is ignored by this module.
+
+% CCSESSION_MSG_INTERNAL error handling CC session message: %1
+There was an internal problem handling an incoming message on the
+command and control channel. An unexpected exception was thrown. This
+most likely points to an internal inconsistency in the module code. The
+exception message is appended to the log error, and the module will
+continue to run, but will not send back an answer.
More information about the bind10-changes
mailing list