poll: stop treating on POLLPRI as 'read'

Current code was considering "can read" as having either POLLIN or POLLPRI being
set.
This may lead to client being awaken because of POLLPRI, starting a blocking
read and getting stuck because there is actually nothing to read.

This patch removes POLLPRI handling in read code and I'll add specific
API to wait for POLLPRI.

https://bugzilla.gnome.org/show_bug.cgi?id=794977
This commit is contained in:
Guillaume Desmottes 2018-04-05 12:19:39 +02:00 committed by Nicolas Dufresne
parent d34f046029
commit 1e321eb51f

View file

@ -1021,9 +1021,9 @@ gst_poll_fd_ctl_read_unlocked (GstPoll * set, GstPollFD * fd, gboolean active)
struct pollfd *pfd = &g_array_index (set->fds, struct pollfd, idx); struct pollfd *pfd = &g_array_index (set->fds, struct pollfd, idx);
if (active) if (active)
pfd->events |= (POLLIN | POLLPRI); pfd->events |= POLLIN;
else else
pfd->events &= ~(POLLIN | POLLPRI); pfd->events &= ~POLLIN;
#else #else
gst_poll_update_winsock_event_mask (set, idx, FD_READ | FD_ACCEPT, active); gst_poll_update_winsock_event_mask (set, idx, FD_READ | FD_ACCEPT, active);
#endif #endif
@ -1201,7 +1201,7 @@ gst_poll_fd_can_read_unlocked (const GstPoll * set, GstPollFD * fd)
#ifndef G_OS_WIN32 #ifndef G_OS_WIN32
struct pollfd *pfd = &g_array_index (set->active_fds, struct pollfd, idx); struct pollfd *pfd = &g_array_index (set->active_fds, struct pollfd, idx);
res = (pfd->revents & (POLLIN | POLLPRI)) != 0; res = (pfd->revents & POLLIN) != 0;
#else #else
WinsockFd *wfd = &g_array_index (set->active_fds, WinsockFd, idx); WinsockFd *wfd = &g_array_index (set->active_fds, WinsockFd, idx);