]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5318] Minor corrections after review.
authorTomek Mrugalski <tomasz@isc.org>
Tue, 4 Jul 2017 14:37:17 +0000 (16:37 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Tue, 4 Jul 2017 14:37:17 +0000 (16:37 +0200)
src/lib/config/command-socket.dox
src/lib/config/command_mgr.cc
src/lib/config/config_messages.mes

index 1bb5f7e548d9e145dadc195d5e3c88bb5284e6c2..798c525980d71b4fccca83b301b6aa372c50c232 100644 (file)
@@ -163,9 +163,9 @@ or HTTPS connection):
 The @ref isc::config::CommandMgr is implemented using boost ASIO and uses
 asynchronous calls to accept new connections and receive commands from the
 controlling clients. ASIO uses IO service object to run asynchronous calls.
-Thus, before the server can use the @ref isc::dhcp::CommandMgr it must
+Thus, before the server can use the @ref isc::config::CommandMgr it must
 provide it with a common instance of the @ref isc::asiolink::IOService
-object using @ref isc::dhcp::CommandMgr::setIOService. The server's
+object using @ref isc::config::CommandMgr::setIOService. The server's
 main loop must contain calls to @ref isc::asiolink::IOService::run or
 @ref isc::asiolink::IOService::poll or their variants to invoke Command
 Manager's handlers as required for processing control requests.
index 6b4a7c044be96eeee0cae2a6ca9c2d65a7f497ef..f0509c36dc0ed22d197f8d4a2525a76fa2b105b7 100644 (file)
@@ -51,6 +51,7 @@ public:
     /// Manager to cause the blocking call to @c select() to return as soon as
     /// a transmission over the control socket is received.
     ///
+    /// @param io_service IOService object used to handle the asio operations
     /// @param socket Pointer to the object representing a socket which is used
     /// for data transmission.
     /// @param connection_pool Reference to the connection pool to which this
@@ -121,8 +122,11 @@ public:
 
     /// @brief Starts asynchronous send over the unix domain socket.
     ///
-    /// This method doesn't block. Once the send operation is completed, the
-    /// @c Connection::sendHandler cllback is invoked.
+    /// This method doesn't block. Once the send operation (that covers the whole
+    /// data if it's small or first BUF_SIZE bytes if its large) is completed, the
+    /// @c Connection::sendHandler callback is invoked. That handler will either
+    /// close the connection gracefully if all data has been sent, or will
+    /// call @ref doSend() again to send the next chunk of data.
     void doSend() {
         size_t chunk_size = (response_.size() < BUF_SIZE) ? response_.size() : BUF_SIZE;
         socket_->asyncSend(&response_[0], chunk_size,
@@ -323,14 +327,15 @@ Connection::sendHandler(const boost::system::error_code& ec,
         }
 
     } else {
-
-        LOG_DEBUG(command_logger, DBG_COMMAND, COMMAND_SOCKET_WRITE)
-            .arg(bytes_transferred).arg(socket_->getNative());
-
         // No error. We are in a process of sending a response. Need to
         // remove the chunk that we have managed to sent with the previous
         // attempt.
         response_.erase(0, bytes_transferred);
+
+        LOG_DEBUG(command_logger, DBG_COMMAND, COMMAND_SOCKET_WRITE)
+            .arg(bytes_transferred).arg(response_.size())
+            .arg(socket_->getNative());
+
         // Check if there is any data left to be sent and sent it.
         if (!response_.empty()) {
             doSend();
index 70c44f7f7703a0fba48ee08df5ad817e4cf5ddc0..eb16266739078153e36164b4b454c29b055cc58a 100644 (file)
@@ -90,7 +90,7 @@ over command socket identified by specified file descriptor.
 This error message indicates that an error was encountered while
 reading from command socket.
 
-% COMMAND_SOCKET_WRITE Sent response of %1 bytes over command socket %2
+% COMMAND_SOCKET_WRITE Sent response of %1 bytes (%2 bytes left to send) over command socket %3
 This debug message indicates that the specified number of bytes was sent
 over command socket identifier by the specified file descriptor.