mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
pulse-server: keep on reading commands until we hit EAGAIN
Only log a warning for anything else than EAGAIN
This commit is contained in:
parent
24280928a9
commit
1507f40eb0
1 changed files with 14 additions and 11 deletions
|
|
@ -248,7 +248,7 @@ static int flush_messages(struct client *client)
|
|||
size_t size;
|
||||
|
||||
if (spa_list_is_empty(&client->out_messages))
|
||||
return 0;
|
||||
break;
|
||||
m = spa_list_first(&client->out_messages, struct message, link);
|
||||
|
||||
if (client->out_index < sizeof(desc)) {
|
||||
|
|
@ -273,12 +273,10 @@ static int flush_messages(struct client *client)
|
|||
while (true) {
|
||||
res = send(client->source->fd, data, size, MSG_NOSIGNAL | MSG_DONTWAIT);
|
||||
if (res < 0) {
|
||||
pw_log_info("send channel:%d %zu, res %d: %m", m->channel, size, res);
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
break;
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
else
|
||||
if (errno != EAGAIN && errno != EWOULDBLOCK)
|
||||
pw_log_warn("send channel:%d %zu, res %d: %m", m->channel, size, res);
|
||||
return -errno;
|
||||
}
|
||||
client->out_index += res;
|
||||
|
|
@ -4140,12 +4138,11 @@ static int do_read(struct client *client)
|
|||
}
|
||||
while (true) {
|
||||
if ((r = recv(client->source->fd, data, size, MSG_DONTWAIT)) < 0) {
|
||||
pw_log_info("recv client:%p res %d: %m", client, res);
|
||||
if (errno == EAGAIN || errno == EWOULDBLOCK)
|
||||
goto exit;
|
||||
if (errno == EINTR)
|
||||
continue;
|
||||
res = -errno;
|
||||
if (errno != EAGAIN && errno != EWOULDBLOCK)
|
||||
pw_log_warn("recv client:%p res %zd: %m", client, r);
|
||||
goto exit;
|
||||
}
|
||||
client->in_index += r;
|
||||
|
|
@ -4223,8 +4220,14 @@ on_client_data(void *data, int fd, uint32_t mask)
|
|||
}
|
||||
if (mask & SPA_IO_IN) {
|
||||
pw_log_trace(NAME" %p: can read", impl);
|
||||
if ((res = do_read(client)) < 0)
|
||||
while (true) {
|
||||
res = do_read(client);
|
||||
if (res < 0) {
|
||||
if (res != -EAGAIN)
|
||||
goto error;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue