]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#432] Addressed review comments
authorMarcin Siodelski <marcin@isc.org>
Wed, 9 Dec 2020 19:42:56 +0000 (20:42 +0100)
committerMarcin Siodelski <marcin@isc.org>
Thu, 10 Dec 2020 07:05:55 +0000 (08:05 +0100)
- Typo in Changelog,
- Moved commentary a few lines up in CA command mgr,
- Added a note about relation between processCommand and handleCommand

ChangeLog
src/bin/agent/ca_command_mgr.cc
src/bin/agent/ca_command_mgr.h
src/lib/config/base_command_mgr.h

index b2a59a3414994032c16e9017a9d90de81022d67d..2907f4e1d07b2e0b1c2c3c0b6aa783135665368b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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)
index db2e80a13441363c24ce93cd226369f4e613ec51..15b0c68a617aad759074d6885ba07adbcd72c0d5 100644 (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));
 
index 1995cb5a72a6015be4f3613b621a264edf72aebb..038353b9c4153bb103079a50db944f2e272879bc 100644 (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.
index 827ca6980fc639eb3b4f4355fd46b580d584b522..9cc5a7f987501601102ad9ab5d16902623143cd7 100644 (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