Module: wine Branch: master Commit: 42ba4d731abf24ba0653c5a9f709de18ab33b82a URL: http://source.winehq.org/git/wine.git/?a=commit;h=42ba4d731abf24ba0653c5a9f7...
Author: Jacek Caban jacek@codeweavers.com Date: Wed May 24 13:52:07 2017 +0200
rpcrt4: Introduce op for closing connection read end and use it when shutting down server.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/rpcrt4/rpc_binding.h | 6 ++++++ dlls/rpcrt4/rpc_server.c | 3 +++ dlls/rpcrt4/rpc_transport.c | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+)
diff --git a/dlls/rpcrt4/rpc_binding.h b/dlls/rpcrt4/rpc_binding.h index ff14bbd..affc060 100644 --- a/dlls/rpcrt4/rpc_binding.h +++ b/dlls/rpcrt4/rpc_binding.h @@ -104,6 +104,7 @@ struct connection_ops { int (*read)(RpcConnection *conn, void *buffer, unsigned int len); int (*write)(RpcConnection *conn, const void *buffer, unsigned int len); int (*close)(RpcConnection *conn); + void (*close_read)(RpcConnection *conn); void (*cancel_call)(RpcConnection *conn); RPC_STATUS (*is_server_listening)(const char *endpoint); int (*wait_for_incoming_data)(RpcConnection *conn); @@ -197,6 +198,11 @@ static inline int rpcrt4_conn_close(RpcConnection *Connection) return Connection->ops->close(Connection); }
+static inline void rpcrt4_conn_close_read(RpcConnection *connection) +{ + connection->ops->close_read(connection); +} + static inline void rpcrt4_conn_cancel_call(RpcConnection *Connection) { Connection->ops->cancel_call(Connection); diff --git a/dlls/rpcrt4/rpc_server.c b/dlls/rpcrt4/rpc_server.c index b76185b..901801e 100644 --- a/dlls/rpcrt4/rpc_server.c +++ b/dlls/rpcrt4/rpc_server.c @@ -669,9 +669,12 @@ static DWORD CALLBACK RPCRT4_server_thread(LPVOID the_arg) { /* cleanup */ cps->ops->free_wait_array(cps, objs); + EnterCriticalSection(&cps->cs); LIST_FOR_EACH_ENTRY(conn, &cps->listeners, RpcConnection, protseq_entry) RPCRT4_CloseConnection(conn); + LIST_FOR_EACH_ENTRY(conn, &cps->connections, RpcConnection, protseq_entry) + rpcrt4_conn_close_read(conn); LeaveCriticalSection(&cps->cs);
if (res == 0 && !std_listen) diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c index b88eeb7..6f83a24 100644 --- a/dlls/rpcrt4/rpc_transport.c +++ b/dlls/rpcrt4/rpc_transport.c @@ -449,6 +449,11 @@ static int rpcrt4_conn_np_close(RpcConnection *conn) return 0; }
+static void rpcrt4_conn_np_close_read(RpcConnection *conn) +{ + /* FIXME */ +} + static void rpcrt4_conn_np_cancel_call(RpcConnection *conn) { RpcConnection_np *connection = (RpcConnection_np *)conn; @@ -1441,6 +1446,11 @@ static int rpcrt4_conn_tcp_close(RpcConnection *conn) return 0; }
+static void rpcrt4_conn_tcp_close_read(RpcConnection *conn) +{ + /* FIXME */ +} + static void rpcrt4_conn_tcp_cancel_call(RpcConnection *conn) { RpcConnection_tcp *connection = (RpcConnection_tcp *) conn; @@ -3066,6 +3076,11 @@ static int rpcrt4_ncacn_http_close(RpcConnection *Connection) return 0; }
+static void rpcrt4_ncacn_http_close_read(RpcConnection *conn) +{ + rpcrt4_ncacn_http_close(conn); /* FIXME */ +} + static void rpcrt4_ncacn_http_cancel_call(RpcConnection *Connection) { RpcConnection_http *httpc = (RpcConnection_http *) Connection; @@ -3119,6 +3134,7 @@ static const struct connection_ops conn_protseq_list[] = { rpcrt4_conn_np_read, rpcrt4_conn_np_write, rpcrt4_conn_np_close, + rpcrt4_conn_np_close_read, rpcrt4_conn_np_cancel_call, rpcrt4_ncacn_np_is_server_listening, rpcrt4_conn_np_wait_for_incoming_data, @@ -3140,6 +3156,7 @@ static const struct connection_ops conn_protseq_list[] = { rpcrt4_conn_np_read, rpcrt4_conn_np_write, rpcrt4_conn_np_close, + rpcrt4_conn_np_close_read, rpcrt4_conn_np_cancel_call, rpcrt4_ncalrpc_np_is_server_listening, rpcrt4_conn_np_wait_for_incoming_data, @@ -3161,6 +3178,7 @@ static const struct connection_ops conn_protseq_list[] = { rpcrt4_conn_tcp_read, rpcrt4_conn_tcp_write, rpcrt4_conn_tcp_close, + rpcrt4_conn_tcp_close_read, rpcrt4_conn_tcp_cancel_call, rpcrt4_conn_tcp_is_server_listening, rpcrt4_conn_tcp_wait_for_incoming_data, @@ -3182,6 +3200,7 @@ static const struct connection_ops conn_protseq_list[] = { rpcrt4_ncacn_http_read, rpcrt4_ncacn_http_write, rpcrt4_ncacn_http_close, + rpcrt4_ncacn_http_close_read, rpcrt4_ncacn_http_cancel_call, rpcrt4_ncacn_http_is_server_listening, rpcrt4_ncacn_http_wait_for_incoming_data,