protocol-native: change some warnings to infos

Errors caused by EPIPE/Connection reset by peer should not cause an
error in the pipewire log, but rather an info.
This commit is contained in:
Torkel Niklasson 2021-12-14 13:31:28 +01:00 committed by Wim Taymans
parent 65b2405262
commit 8abd6b3fe4
2 changed files with 10 additions and 2 deletions

View file

@ -291,7 +291,7 @@ client_busy_changed(void *data, bool busy)
static void handle_client_error(struct pw_impl_client *client, int res)
{
if (res == -EPIPE)
if (res == -EPIPE || res == -ECONNRESET)
pw_log_info("%p: client %p disconnected", client->protocol, client);
else
pw_log_error("%p: client %p error %d (%s)", client->protocol,

View file

@ -167,6 +167,14 @@ static void *connection_ensure_size(struct pw_protocol_native_connection *conn,
return (uint8_t *) buf->buffer_data + buf->buffer_size;
}
static void handle_connection_error(struct pw_protocol_native_connection *conn, int res)
{
if (res == -EPIPE || res == -ECONNRESET)
pw_log_info("connection %p: could not recvmsg on fd:%d: %s", conn, conn->fd, strerror(res));
else
pw_log_error("connection %p: could not recvmsg on fd:%d: %s", conn, conn->fd, strerror(res));
}
static int refill_buffer(struct pw_protocol_native_connection *conn, struct buffer *buf)
{
ssize_t len;
@ -224,7 +232,7 @@ static int refill_buffer(struct pw_protocol_native_connection *conn, struct buff
/* ERRORS */
recv_error:
pw_log_error("connection %p: could not recvmsg on fd:%d: %m", conn, conn->fd);
handle_connection_error(conn, errno);
return -errno;
}