mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
protocol-native: refactor handle client errors
So that we don't spam the log with warnings See #385
This commit is contained in:
parent
813af52072
commit
14f68565ad
1 changed files with 13 additions and 12 deletions
|
|
@ -271,6 +271,16 @@ client_busy_changed(void *data, bool busy)
|
||||||
process_messages(c);
|
process_messages(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void handle_client_error(struct pw_impl_client *client, int res)
|
||||||
|
{
|
||||||
|
if (res == -EPIPE)
|
||||||
|
pw_log_info(NAME" %p: client %p disconnected", client->protocol, client);
|
||||||
|
else
|
||||||
|
pw_log_error(NAME" %p: client %p error %d (%s)", client->protocol,
|
||||||
|
client, res, spa_strerror(res));
|
||||||
|
pw_impl_client_destroy(client);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
connection_data(void *data, int fd, uint32_t mask)
|
connection_data(void *data, int fd, uint32_t mask)
|
||||||
{
|
{
|
||||||
|
|
@ -302,12 +312,7 @@ connection_data(void *data, int fd, uint32_t mask)
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
error:
|
error:
|
||||||
if (res == -EPIPE)
|
handle_client_error(client, res);
|
||||||
pw_log_info(NAME" %p: client %p disconnected", client->protocol, client);
|
|
||||||
else
|
|
||||||
pw_log_error(NAME" %p: client %p error %d (%s)", client->protocol,
|
|
||||||
client, res, spa_strerror(res));
|
|
||||||
pw_impl_client_destroy(client);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void client_free(void *data)
|
static void client_free(void *data)
|
||||||
|
|
@ -1043,12 +1048,8 @@ static void on_before_hook(void *_data)
|
||||||
SPA_FLAG_SET(mask, SPA_IO_OUT);
|
SPA_FLAG_SET(mask, SPA_IO_OUT);
|
||||||
pw_loop_update_io(data->client->context->main_loop,
|
pw_loop_update_io(data->client->context->main_loop,
|
||||||
data->source, mask);
|
data->source, mask);
|
||||||
} else if (res < 0) {
|
} else if (res < 0)
|
||||||
pw_log_warn("client %p: could not flush: %s",
|
handle_client_error(data->client, res);
|
||||||
data->client, spa_strerror(res));
|
|
||||||
pw_impl_client_destroy(data->client);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue