]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#4341] Addressed comments
authorFrancis Dupont <fdupont@isc.org>
Thu, 7 May 2026 12:14:29 +0000 (14:14 +0200)
committerFrancis Dupont <fdupont@isc.org>
Thu, 7 May 2026 12:14:29 +0000 (14:14 +0200)
src/lib/config/http_command_response_creator.cc
src/lib/config/http_command_response_creator.h

index 066d5b21126e78938b24603e96fbcc5accf89369..1603218d2bc467f31a4cfa60a6dcfe109695aed6 100644 (file)
@@ -172,15 +172,15 @@ HttpCommandResponseCreator::createDynamicHttpResponse(HttpRequestPtr request) {
     // Process command doesn't generate exceptions but can possibly return
     // null response, if the handler is not implemented properly. This is
     // again an internal server issue.
-    // Check service first.
+    // Check the services argument first.
     ConstElementPtr response = checkService(command);
     if (!response) {
         response = config::CommandMgr::instance().processCommand(command);
-    }
-
-    if (!response) {
-        // Notify the client that we have a problem with our server.
-        return (createStockHttpResponse(request, HttpStatusCode::INTERNAL_SERVER_ERROR));
+        if (!response) {
+            // Notify the client that we have a problem with our server.
+            return (createStockHttpResponse(request,
+                        HttpStatusCode::INTERNAL_SERVER_ERROR));
+        }
     }
 
     // Normal Responses coming from the Kea server must always be wrapped in
index 3e6918847916b188526bb37eb79aea5154864e33..f96e153a6df5ea01ae56e49d4ace764deffaf21d 100644 (file)
@@ -87,7 +87,10 @@ private:
     virtual http::HttpResponsePtr
     createDynamicHttpResponse(http::HttpRequestPtr request);
 
-    /// @brief Check the service.
+    /// @brief Checks the services argument.
+    ///
+    /// If the command includes a services argument it must match the response
+    /// creator's service name. If not an error response is returned.
     ///
     /// @param command The command.
     /// @return A response with the error or null.