mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-05 13:30:02 -05:00
pulse-server: client: do not queue messages after disconnect
Do not queue messages to be delivered to a client if that client has already disconnected.
This commit is contained in:
parent
d939fa5b1c
commit
5ef9deae83
1 changed files with 10 additions and 0 deletions
|
|
@ -182,6 +182,11 @@ int client_queue_message(struct client *client, struct message *msg)
|
||||||
if (msg == NULL)
|
if (msg == NULL)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
if (client->disconnect) {
|
||||||
|
res = -ENOTCONN;
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
if (msg->length == 0) {
|
if (msg->length == 0) {
|
||||||
res = 0;
|
res = 0;
|
||||||
goto error;
|
goto error;
|
||||||
|
|
@ -212,6 +217,8 @@ int client_flush_messages(struct client *client)
|
||||||
struct impl *impl = client->impl;
|
struct impl *impl = client->impl;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
spa_assert(!client->disconnect);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
struct message *m;
|
struct message *m;
|
||||||
struct descriptor desc;
|
struct descriptor desc;
|
||||||
|
|
@ -269,6 +276,9 @@ int client_queue_subscribe_event(struct client *client, uint32_t mask, uint32_t
|
||||||
struct impl *impl = client->impl;
|
struct impl *impl = client->impl;
|
||||||
struct message *reply, *m, *t;
|
struct message *reply, *m, *t;
|
||||||
|
|
||||||
|
if (client->disconnect)
|
||||||
|
return -ENOTCONN;
|
||||||
|
|
||||||
if (!(client->subscribed & mask))
|
if (!(client->subscribed & mask))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue