]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[153-netconf-control-socket] Addressed review comments 153-netconf-control-socket
authorFrancis Dupont <fdupont@isc.org>
Tue, 16 Oct 2018 16:27:24 +0000 (18:27 +0200)
committerFrancis Dupont <fdupont@isc.org>
Tue, 16 Oct 2018 16:34:34 +0000 (12:34 -0400)
src/bin/netconf/http_control_socket.h
src/bin/netconf/stdout_control_socket.cc
src/bin/netconf/tests/control_socket_unittests.cc
src/bin/netconf/unix_control_socket.cc
src/bin/netconf/unix_control_socket.h

index 752f13b0ec6862908ecd6f7ee10251379b68a039..48023733cefc1aa5dfed638cc08697c541bb7b36 100644 (file)
@@ -63,7 +63,10 @@ public:
                                             const std::string& service);
 
 private:
-    /// @brief Preform the actual communication.
+    /// @brief Perform the actual communication.
+    ///
+    /// @todo Use persistent connections (vs. a new connection per call)
+    /// as the HTTP library supports them.
     ///
     /// @param command The command to send.
     /// @return The answer.
index d0219016e0b8eccee575477334a367e4cd7e18af..0477ea2f48dfa90397383606975863edae43c71c 100644 (file)
@@ -50,9 +50,6 @@ StdoutControlSocket::configTest(ConstElementPtr /*config*/,
 ConstElementPtr
 StdoutControlSocket::configSet(ConstElementPtr config,
                                const string& service) {
-    output_ << "//////////////// "
-            << service << " configuration "
-            << "////////////////" << endl;
     prettyPrint(config, output_);
     output_ << endl;
     return (createAnswer());
index ba8491496afb96ca6d594513c80c3dbe52d00eb1..0bd2f81c7cecdc84ac89b2f042d950c20a72d16d 100644 (file)
@@ -119,8 +119,7 @@ TEST(StdoutControlSocketTest, configSet) {
     EXPECT_EQ("{ \"result\": 0 }", answer->str());
 
     // Check output.
-    string expected = "//////////////// foo configuration ////////////////\n"
-        "{\n  \"bar\": 1\n}\n";
+    string expected = "{\n  \"bar\": 1\n}\n";
     EXPECT_EQ(expected, os.str());
 }
 
index 2553371e8a8b6ecce3a3846a9fe84e81bb581c9a..93a807eb1d69dadb09ac401a0fbce237d7fd4b5b 100644 (file)
@@ -56,6 +56,7 @@ UnixControlSocket::configSet(ConstElementPtr config,
 
 ConstElementPtr
 UnixControlSocket::sendCommand(ConstElementPtr command) {
+    // We are using our own IO service because this method is synchronous.
     IOServicePtr io_service(new IOService());
     ClientConnection conn(*io_service);
     boost::system::error_code received_ec;
index 08c95897653eecee82f0c6d7d5d2ec47967c4da2..09fe7c1e99521128ed20780b9ead6b2352e8eed8 100644 (file)
@@ -63,7 +63,10 @@ public:
                                             const std::string& service);
 
 private:
-    /// @brief Preform the actual communication.
+    /// @brief Perform the actual communication.
+    ///
+    /// @note This method is synchronous, i.e. it blocks until it finishes
+    /// and returns.
     ///
     /// @param command The command to send.
     /// @return The answer.