diff options
author | RODRIGUEZ Christophe <chrisrodri@free.fr> | 2019-08-17 10:43:20 +0000 |
---|---|---|
committer | Arun Raghavan <arun@arunraghavan.net> | 2019-08-17 10:43:20 +0000 |
commit | 2e7c0ee8f802bf5fbd457bd73c28816d54c29c7d (patch) | |
tree | 338b8523bc67635ebd5b2f76dc638f657ebc3489 | |
parent | 27e72814d0921c43c31071fa2cbd0e23f4638af5 (diff) | |
download | pulseaudio-2e7c0ee8f802bf5fbd457bd73c28816d54c29c7d.tar.gz |
raop: Fix infinite loop in raop-sink with UDP mode
There are potentially unresolved issues around the EAGAIN logic, but
this should prevent an infinite loop and log flood in the mean time.
Fixes: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/695
-rw-r--r-- | src/modules/raop/raop-sink.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/modules/raop/raop-sink.c b/src/modules/raop/raop-sink.c index 02cf56aa..d5ce6dc2 100644 --- a/src/modules/raop/raop-sink.c +++ b/src/modules/raop/raop-sink.c @@ -388,6 +388,10 @@ static void thread_func(void *userdata) { ssize_t read; for (i = 0; i < nbfds; i++) { + if (pollfd->revents & POLLERR) { + /* one of UDP fds is in faulty state, may have been disconnected, this is fatal */ + goto fail; + } if (pollfd->revents & pollfd->events) { pollfd->revents = 0; read = pa_read(pollfd->fd, packet, sizeof(packet), NULL); @@ -431,7 +435,7 @@ static void thread_func(void *userdata) { /* Just try again. */ pa_log_debug("Failed to write data to FIFO (EINTR), retrying"); goto fail; - } else if (errno != EAGAIN) { + } else if (errno != EAGAIN && !u->oob) { /* Buffer is full, wait for POLLOUT. */ pollfd->events = POLLOUT; pollfd->revents = 0; |