2b7f8a3af7
This is an automated DistroBaker update from upstream sources. If you do not know what this is about or would like to opt out, contact the OSCI team. Source: https://src.fedoraproject.org/rpms/pipewire.git#be385b8bead20dac22768069ec795e9366c11590
40 lines
1.4 KiB
Diff
40 lines
1.4 KiB
Diff
From 165ad6e75816f6d8b3273261a4f6d6dd8b7457f6 Mon Sep 17 00:00:00 2001
|
|
From: Wim Taymans <wtaymans@redhat.com>
|
|
Date: Sat, 31 Oct 2020 21:21:00 +0100
|
|
Subject: [PATCH 3/3] pulse-server: don't ever block
|
|
|
|
Handle EAGAIN and EWOULDBLOCK and go back into the poll loop instead
|
|
of blocking.
|
|
---
|
|
src/modules/module-protocol-pulse/pulse-server.c | 7 ++++++-
|
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/src/modules/module-protocol-pulse/pulse-server.c b/src/modules/module-protocol-pulse/pulse-server.c
|
|
index dbc52431..e1733b29 100644
|
|
--- a/src/modules/module-protocol-pulse/pulse-server.c
|
|
+++ b/src/modules/module-protocol-pulse/pulse-server.c
|
|
@@ -267,6 +267,8 @@ static int flush_messages(struct client *client)
|
|
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
|
|
@@ -3974,7 +3976,10 @@ static int do_read(struct client *client)
|
|
size = client->message->length - idx;
|
|
}
|
|
while (true) {
|
|
- if ((r = recv(client->source->fd, data, size, 0)) < 0) {
|
|
+ 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;
|
|
--
|
|
2.28.0
|
|
|