unix-socket: Avoid spurious logs on close

Avoid spurious logs when suricatasc closes connection.

Use SCLogDebug for control connection EOF, and SCLogError for an error.

As Chandan Chowdhury described in redmine 3685. This makes the logging
consistent with the older `if (client->version <= UNIX_PROTO_V1)` block
about 20 lines above, and avoids polluting the logs with
`Unix socket: lost connection with client`.
pull/6306/head
Michael Smith 4 years ago committed by Victor Julien
parent 3e81d20a71
commit a64783b3e2

@ -572,9 +572,9 @@ static void UnixCommandRun(UnixCommand * this, UnixClient *client)
do {
if (ret <= 0) {
if (ret == 0) {
SCLogInfo("Unix socket: lost connection with client");
SCLogDebug("Unix socket: lost connection with client");
} else {
SCLogInfo("Unix socket: error on recv() from client: %s",
SCLogError(SC_ERR_SOCKET, "Unix socket: error on recv() from client: %s",
strerror(errno));
}
UnixCommandClose(this, client->fd);

Loading…
Cancel
Save