From 2fad531cb5441d833842f5fe16bc13097b3a403f Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Tue, 21 Mar 2017 13:03:12 +0100 Subject: [PATCH] server: Implement disconnecting message queue. Signed-off-by: Jacek Caban Signed-off-by: Alexandre Julliard --- server/named_pipe.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/server/named_pipe.c b/server/named_pipe.c index 044bc973942..6dc032d2a6a 100644 --- a/server/named_pipe.c +++ b/server/named_pipe.c @@ -401,6 +401,21 @@ static void pipe_end_disconnect( struct pipe_end *pipe_end, unsigned int status pipe_end->connection = NULL; + if (use_server_io( pipe_end )) + { + struct pipe_message *message, *next; + struct async *async; + if (pipe_end->fd) fd_async_wake_up( pipe_end->fd, ASYNC_TYPE_WAIT, status ); + LIST_FOR_EACH_ENTRY_SAFE( message, next, &pipe_end->message_queue, struct pipe_message, entry ) + { + async = message->async; + if (async || status == STATUS_PIPE_DISCONNECTED) free_message( message ); + if (!async) continue; + async_terminate( async, status ); + release_object( async ); + } + if (status == STATUS_PIPE_DISCONNECTED) set_fd_signaled( pipe_end->fd, 0 ); + } if (connection) { connection->connection = NULL; -- 2.11.4.GIT