Commit f9107953 authored by JINMEI Tatuya's avatar JINMEI Tatuya
Browse files

minor editorial/style suggested fixes:

 - brace position
 - missing parentheses
 - redundant white spaces in a blank line
 - made ModuleCCSession::checkModuleCommand() a const member function
parent 14c9baf0
......@@ -286,29 +286,31 @@ ModuleCCSession::hasQueuedMsgs() const {
ConstElementPtr
ModuleCCSession::checkConfigUpdateCommand(const std::string& target_module,
ConstElementPtr arg) {
ConstElementPtr arg)
{
if (target_module == module_name_) {
return handleConfigUpdate(arg);
return (handleConfigUpdate(arg));
} else {
// ok this update is not for us, if we have this module
// in our remote config list, update that
updateRemoteConfig(target_module, arg);
// we're not supposed to answer to this, so return
return ElementPtr();
return (ElementPtr());
}
}
ConstElementPtr
ModuleCCSession::checkModuleCommand(const std::string& cmd_str,
const std::string& target_module,
ConstElementPtr arg) {
ConstElementPtr arg) const
{
if (target_module == module_name_) {
if (command_handler_) {
ElementPtr errors = Element::createList();
if (module_specification_.validateCommand(cmd_str,
arg,
errors)) {
return command_handler_(cmd_str, arg);
return (command_handler_(cmd_str, arg));
} else {
std::stringstream ss;
ss << "Error in command validation: ";
......@@ -316,15 +318,15 @@ ModuleCCSession::checkModuleCommand(const std::string& cmd_str,
errors->listValue()) {
ss << error->stringValue();
}
return createAnswer(3, ss.str());
return (createAnswer(3, ss.str()));
}
} else {
return createAnswer(1,
"Command given but no "
"command handler for module");
return (createAnswer(1,
"Command given but no "
"command handler for module"));
}
}
return ElementPtr();
return (ElementPtr());
}
int
......
......@@ -249,11 +249,11 @@ private:
isc::data::ConstElementPtr checkConfigUpdateCommand(
const std::string& target_module,
isc::data::ConstElementPtr arg);
isc::data::ConstElementPtr checkModuleCommand(
const std::string& cmd_str,
const std::string& target_module,
isc::data::ConstElementPtr arg);
isc::data::ConstElementPtr arg) const;
isc::data::ConstElementPtr(*config_handler_)(
isc::data::ConstElementPtr new_config);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment