Commit f928580a authored by Mike Kaplinskiy's avatar Mike Kaplinskiy Committed by Alexandre Julliard

server: Set FD_READ in only 1 place (cleanup).

parent 688b94b4
......@@ -381,18 +381,9 @@ static void sock_poll_event( struct fd *fd, int event )
/* Linux 2.4 doesn't report POLLHUP if only one side of the socket
* has been closed, so we need to check for it explicitly here */
nr = recv( get_unix_fd( fd ), &dummy, 1, MSG_PEEK );
if ( nr > 0 )
{
/* incoming data */
sock->pmask |= FD_READ;
sock->hmask |= (FD_READ|FD_CLOSE);
sock->errors[FD_READ_BIT] = 0;
if (debug_level)
fprintf(stderr, "socket %p is readable\n", sock );
}
else if ( nr == 0 )
if ( nr == 0 )
hangup_seen = 1;
else
else if ( nr < 0 )
{
/* EAGAIN can happen if an async recv() falls between the server's poll()
call and the invocation of this routine */
......@@ -411,14 +402,14 @@ static void sock_poll_event( struct fd *fd, int event )
{
hangup_seen = 1;
}
else if ( event & POLLIN ) /* POLLIN for non-stream socket */
if ( event & POLLIN && !hangup_seen )
{
sock->pmask |= FD_READ;
sock->hmask |= (FD_READ|FD_CLOSE);
sock->errors[FD_READ_BIT] = 0;
if (debug_level)
fprintf(stderr, "socket %p is readable\n", sock );
}
if (event & POLLOUT)
......
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