Commit 9bc5bc7c authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Remove the socket from the polling loop if it was aborted.

Don't use rd_shutdown and wr_shutdown to determine this. On the one hand, it's possible to have pending asyncs even if rd_shutdown && wr_shutdown, which will be cheerfully completed upon receiving data. On the other hand, RST doesn't cause WSAESHUTDOWN, but rather WSAECONNRESET. Signed-off-by: 's avatarZebediah Figura <zfigura@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 361435f6
......@@ -215,6 +215,7 @@ struct sock
unsigned int wr_shutdown : 1; /* is the write end shut down? */
unsigned int wr_shutdown_pending : 1; /* is a write shutdown pending? */
unsigned int hangup : 1; /* has the read end received a hangup? */
unsigned int aborted : 1; /* did we get a POLLERR or irregular POLLHUP? */
unsigned int nonblocking : 1; /* is the socket nonblocking? */
unsigned int bound : 1; /* is the socket bound? */
};
......@@ -1079,8 +1080,7 @@ static void sock_poll_event( struct fd *fd, int event )
}
else if (event & (POLLHUP | POLLERR))
{
sock->rd_shutdown = 1;
sock->wr_shutdown = 1;
sock->aborted = 1;
if (debug_level)
fprintf( stderr, "socket %p aborted by error %d, event %#x\n", sock, error, event );
......@@ -1175,6 +1175,9 @@ static int sock_get_poll_events( struct fd *fd )
return -1;
}
if (sock->aborted)
return -1;
if (sock->accept_recv_req)
{
ev |= POLLIN;
......@@ -1403,6 +1406,7 @@ static struct sock *create_socket(void)
sock->wr_shutdown = 0;
sock->wr_shutdown_pending = 0;
sock->hangup = 0;
sock->aborted = 0;
sock->nonblocking = 0;
sock->bound = 0;
sock->rcvbuf = 0;
......
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