2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-03 15:35:17 +00:00

[#432] Addressed review comments

- Typo in Changelog,
- Moved commentary a few lines up in CA command mgr,
- Added a note about relation between processCommand and handleCommand
This commit is contained in:
Marcin Siodelski
2020-12-09 20:42:56 +01:00
parent 623f63a0cb
commit e07b37b105
4 changed files with 10 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
1844. [bug] marcin
Corrected a bug in Kea Control Agent error responses when
Corrected a bug in Kea Control Agent error responses when a
malformed command was sent. In some cases a map with an error
response was returned instead of a list.
(Gitlab #432)

View File

@@ -48,13 +48,12 @@ isc::data::ConstElementPtr
CtrlAgentCommandMgr::processCommand(const isc::data::ConstElementPtr& cmd) {
ConstElementPtr answer = HookedCommandMgr::processCommand(cmd);
if (answer->getType() == Element::list) {
return (answer);
}
// Responses from the Kea Control Agent must be always wrapped
// in a list because in general they contain responses from
// multiple daemons.
if (answer->getType() == Element::list) {
return (answer);
}
ElementPtr answer_list = Element::createList();
answer_list->add(boost::const_pointer_cast<Element>(answer));

View File

@@ -51,6 +51,9 @@ public:
/// error response must also be wrapped in a list because caller expects
/// that CA always returns a list.
///
/// This method is an entry point for dealing with a command. Internally
/// it calls @c CtrlAgentCommandMgr::handleCommand.
///
/// @param cmd Pointer to the data element representing command in JSON
/// format.
/// @return Pointer to the response.

View File

@@ -115,6 +115,9 @@ public:
/// This method is virtual so it can be overridden in derived classes to
/// pre-process command and post-process response if necessary.
///
/// This method is an entry point for dealing with a command. Internally
/// it calls @c BaseCommandMgr::handleCommand.
///
/// @param cmd Pointer to the data element representing command in JSON
/// format.
virtual isc::data::ConstElementPtr