Commit 44581af9 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

server: Always try return a named pipe server that is listening from find_available_server.

We still fallback to an idle server, but this prevents a client from connecting to a named pipe server that isn't listening.
parent e70848ed
......@@ -772,11 +772,20 @@ static struct pipe_server *find_available_server( struct named_pipe *pipe )
{
struct pipe_server *server;
/* look for pipe servers that are listening */
LIST_FOR_EACH_ENTRY( server, &pipe->servers, struct pipe_server, entry )
{
if (server->state == ps_idle_server || server->state == ps_wait_open)
if (server->state == ps_wait_open)
return (struct pipe_server *)grab_object( server );
}
/* fall back to pipe servers that are idle */
LIST_FOR_EACH_ENTRY( server, &pipe->servers, struct pipe_server, entry )
{
if (server->state == ps_idle_server)
return (struct pipe_server *)grab_object( server );
}
return NULL;
}
......
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