Commit 0bbcd619 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[3880] Changes after review:

 - log messages in commandReader are now errors, not warnings
 - missing doxygen comment added
parent c0f65ef8
......@@ -140,7 +140,7 @@ CommandMgr::commandReader(int sockfd) {
int rval = read(sockfd, buf, sizeof(buf));
if (rval < 0) {
// Read failed
LOG_WARN(command_logger, COMMAND_SOCKET_READ_FAIL).arg(rval).arg(sockfd);
LOG_ERROR(command_logger, COMMAND_SOCKET_READ_FAIL).arg(rval).arg(sockfd);
/// @todo: Should we close the connection, similar to what is already
/// being done for rval == 0?
......@@ -180,7 +180,7 @@ CommandMgr::commandReader(int sockfd) {
if (len > 65535) {
// Hmm, our response is too large. Let's send the first
// 64KB and hope for the best.
LOG_WARN(command_logger, COMMAND_SOCKET_RESPONSE_TOOLARGE).arg(len);
LOG_ERROR(command_logger, COMMAND_SOCKET_RESPONSE_TOOLARGE).arg(len);
len = 65535;
}
......@@ -194,7 +194,7 @@ CommandMgr::commandReader(int sockfd) {
// Response transmission failed. Since the response failed, it doesn't
// make sense to send any status codes. Let's log it and be done with
// it.
LOG_WARN(command_logger, COMMAND_SOCKET_WRITE_FAIL).arg(len).arg(sockfd);
LOG_ERROR(command_logger, COMMAND_SOCKET_WRITE_FAIL).arg(len).arg(sockfd);
}
}
......
......@@ -67,6 +67,7 @@ private:
/// @brief Auxiliary method for creating a UNIX socket
///
/// @param file_name specifies socket file path
/// @return socket file descriptor
int createUnixSocket(const std::string& file_name) {
int fd = socket(AF_UNIX, SOCK_STREAM, 0);
......
......@@ -52,7 +52,7 @@ This debug message indicates that specified number of bytes was received
over command socket identified by specified file descriptor.
% COMMAND_SOCKET_READ_FAIL Encountered error %1 while reading from command socket %2
This warning message indicates that an error was encountered while
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
......@@ -60,14 +60,14 @@ This debug message indicates that the specified number of bytes was sent
over command socket identifier by the specified file descriptor.
% COMMAND_SOCKET_RESPONSE_TOOLARGE Server's response was larger (%1) than supported 64KB
This warning message indicates that the server received a command and generated
This error message indicates that the server received a command and generated
an answer for it, but that response was larger than supported 64KB. Server
will attempt to send the first 64KB of the response. Depending on the nature
of this response, this may indicate a software or configuration error. Future
Kea versions are expected to have better support for large responses.
% COMMAND_SOCKET_WRITE_FAIL Error while writing %1 bytes to command socket %2
This warning message indicates that an error was encountered while
This error message indicates that an error was encountered while
attempting to send a response to the command socket.
% COMMAND_SOCKET_UNIX_OPEN Command socket opened: UNIX, fd=%1, path=%2
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment