mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-04 13:30:12 -05:00
pulse-server: client: restructure message handling
Move all I/O event source modifications into client.c.
This commit is contained in:
parent
5ef9deae83
commit
4678ea06a0
3 changed files with 80 additions and 60 deletions
|
|
@ -275,7 +275,6 @@ static void
|
|||
on_client_data(void *data, int fd, uint32_t mask)
|
||||
{
|
||||
struct client * const client = data;
|
||||
struct impl * const impl = client->impl;
|
||||
int res;
|
||||
|
||||
client->ref++;
|
||||
|
|
@ -302,15 +301,9 @@ on_client_data(void *data, int fd, uint32_t mask)
|
|||
}
|
||||
}
|
||||
|
||||
if (mask & SPA_IO_OUT || client->need_flush) {
|
||||
pw_log_trace("client %p: can write", client);
|
||||
client->need_flush = false;
|
||||
if (mask & SPA_IO_OUT || client->new_msg_since_last_flush) {
|
||||
res = client_flush_messages(client);
|
||||
if (res >= 0) {
|
||||
int m = client->source->mask;
|
||||
SPA_FLAG_CLEAR(m, SPA_IO_OUT);
|
||||
pw_loop_update_io(impl->loop, client->source, m);
|
||||
} else if (res != -EAGAIN && res != -EWOULDBLOCK)
|
||||
if (res < 0)
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue