server: Use pipe_end state in find_available_server.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2018-08-17 17:41:08 +02:00 committed by Alexandre Julliard
parent 03317d10a0
commit 0531931278
1 changed files with 2 additions and 2 deletions

View File

@ -1128,14 +1128,14 @@ static struct pipe_server *find_available_server( struct named_pipe *pipe )
/* look for pipe servers that are listening */ /* look for pipe servers that are listening */
LIST_FOR_EACH_ENTRY( server, &pipe->servers, struct pipe_server, entry ) LIST_FOR_EACH_ENTRY( server, &pipe->servers, struct pipe_server, entry )
{ {
if (server->state == ps_wait_open) if (server->pipe_end.state == FILE_PIPE_LISTENING_STATE && async_queued( &server->listen_q ))
return (struct pipe_server *)grab_object( server ); return (struct pipe_server *)grab_object( server );
} }
/* fall back to pipe servers that are idle */ /* fall back to pipe servers that are idle */
LIST_FOR_EACH_ENTRY( server, &pipe->servers, struct pipe_server, entry ) LIST_FOR_EACH_ENTRY( server, &pipe->servers, struct pipe_server, entry )
{ {
if (server->state == ps_idle_server) if (server->pipe_end.state == FILE_PIPE_LISTENING_STATE )
return (struct pipe_server *)grab_object( server ); return (struct pipe_server *)grab_object( server );
} }