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

server: In case of hangup/error, wake up all asyncs that can no longer be completed.

parent 394a1422
...@@ -299,16 +299,23 @@ static void sock_dispatch_asyncs( struct sock *sock, int event ) ...@@ -299,16 +299,23 @@ static void sock_dispatch_asyncs( struct sock *sock, int event )
{ {
if ( sock->flags & WSA_FLAG_OVERLAPPED ) if ( sock->flags & WSA_FLAG_OVERLAPPED )
{ {
if ( event & (POLLIN|POLLPRI|POLLERR|POLLHUP) && async_waiting( sock->read_q )) if ( event & (POLLIN|POLLPRI) && async_waiting( sock->read_q ) )
{ {
if (debug_level) fprintf( stderr, "activating read queue for socket %p\n", sock ); if (debug_level) fprintf( stderr, "activating read queue for socket %p\n", sock );
async_wake_up( sock->read_q, STATUS_ALERTED ); async_wake_up( sock->read_q, STATUS_ALERTED );
} }
if ( event & (POLLOUT|POLLERR|POLLHUP) && async_waiting( sock->write_q )) if ( event & POLLOUT && async_waiting( sock->write_q ) )
{ {
if (debug_level) fprintf( stderr, "activating write queue for socket %p\n", sock ); if (debug_level) fprintf( stderr, "activating write queue for socket %p\n", sock );
async_wake_up( sock->write_q, STATUS_ALERTED ); async_wake_up( sock->write_q, STATUS_ALERTED );
} }
if ( event & (POLLERR|POLLHUP) )
{
if ( !(sock->state & FD_READ) )
async_wake_up( sock->read_q, STATUS_SUCCESS );
if ( !(sock->state & FD_WRITE) )
async_wake_up( sock->write_q, STATUS_SUCCESS );
}
} }
} }
......
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