Signed-off-by: Zebediah Figura z.figura12@gmail.com --- server/sock.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-)
diff --git a/server/sock.c b/server/sock.c index 1d992d8f9e4..e1b30507514 100644 --- a/server/sock.c +++ b/server/sock.c @@ -1063,11 +1063,20 @@ static int sock_get_poll_events( struct fd *fd ) { if (async_waiting( &sock->read_q )) ev |= POLLIN | POLLPRI; } - else if (!sock->rd_shutdown && (mask & AFD_POLL_READ)) - ev |= POLLIN | POLLPRI; - /* We use POLLIN with 0 bytes recv() as hangup indication for stream sockets. */ - else if (sock->state == SOCK_CONNECTED && (mask & AFD_POLL_HUP) && !(sock->reported_events & AFD_POLL_READ)) - ev |= POLLIN; + else + { + if (!sock->rd_shutdown) + { + if (mask & AFD_POLL_READ) + ev |= POLLIN; + if (mask & AFD_POLL_OOB) + ev |= POLLPRI; + } + + /* We use POLLIN with 0 bytes recv() as hangup indication for stream sockets. */ + if (sock->state == SOCK_CONNECTED && (mask & AFD_POLL_HUP) && !(sock->reported_events & AFD_POLL_READ)) + ev |= POLLIN; + }
if (async_queued( &sock->write_q )) {