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)
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));
/// 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.
/// 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