Commit 2daf7643 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Do not poll sockets for POLLPRI unless we are selecting for AFD_POLL_OOB.

parent 69549fc0
...@@ -1063,11 +1063,20 @@ static int sock_get_poll_events( struct fd *fd ) ...@@ -1063,11 +1063,20 @@ static int sock_get_poll_events( struct fd *fd )
{ {
if (async_waiting( &sock->read_q )) ev |= POLLIN | POLLPRI; if (async_waiting( &sock->read_q )) ev |= POLLIN | POLLPRI;
} }
else if (!sock->rd_shutdown && (mask & AFD_POLL_READ)) else
ev |= POLLIN | POLLPRI; {
/* We use POLLIN with 0 bytes recv() as hangup indication for stream sockets. */ if (!sock->rd_shutdown)
else if (sock->state == SOCK_CONNECTED && (mask & AFD_POLL_HUP) && !(sock->reported_events & AFD_POLL_READ)) {
ev |= POLLIN; 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 )) if (async_queued( &sock->write_q ))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment