From: Tomek Mrugalski Date: Tue, 16 Jun 2015 15:11:46 +0000 (+0200) Subject: [3880] Changes after review: X-Git-Tag: trac3830_base~5^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0bbcd6190810f96b49d5e39537ae3077b1ec536d;p=thirdparty%2Fkea.git [3880] Changes after review: - log messages in commandReader are now errors, not warnings - missing doxygen comment added --- diff --git a/src/lib/config/command_mgr.cc b/src/lib/config/command_mgr.cc index 0c6d9e9984..330f440378 100644 --- a/src/lib/config/command_mgr.cc +++ b/src/lib/config/command_mgr.cc @@ -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); } } diff --git a/src/lib/config/command_socket_factory.cc b/src/lib/config/command_socket_factory.cc index 77a868306d..3193201e10 100644 --- a/src/lib/config/command_socket_factory.cc +++ b/src/lib/config/command_socket_factory.cc @@ -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); diff --git a/src/lib/config/config_messages.mes b/src/lib/config/config_messages.mes index 97392eeebc..de1f02c489 100644 --- a/src/lib/config/config_messages.mes +++ b/src/lib/config/config_messages.mes @@ -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