forked from Mirrors/wine-wine
server: In case of hangup/error, wake up all asyncs that can no longer be completed.
parent
394a142237
commit
be230adbb7
|
@ -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 );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue