From a30d6130869239a6d6160c50908092e1d1424af5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 21 Sep 2009 19:57:27 -0700 Subject: s4-rpcserver: run all RPC operations in a single task This will make it much easier to implement shared handles with association groups. It also means we can shared the ldb between RPC connections. --- source4/rpc_server/service_rpc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source4/rpc_server') diff --git a/source4/rpc_server/service_rpc.c b/source4/rpc_server/service_rpc.c index 64c6728322..ea416894d0 100644 --- a/source4/rpc_server/service_rpc.c +++ b/source4/rpc_server/service_rpc.c @@ -39,6 +39,7 @@ #include "../lib/util/tevent_ntstatus.h" #include "libcli/raw/smb.h" #include "../libcli/named_pipe_auth/npa_tstream.h" +#include "smbd/process_model.h" struct dcesrv_socket_context { const struct dcesrv_endpoint *endpoint; @@ -685,11 +686,17 @@ static void dcesrv_task_init(struct task_server *task) NTSTATUS status; struct dcesrv_context *dce_ctx; struct dcesrv_endpoint *e; + const struct model_ops *model_ops; dcerpc_server_init(task->lp_ctx); task_server_set_title(task, "task[dcesrv]"); + /* run the rpc server as a single process to allow for shard + * handles, and sharing of ldb contexts */ + model_ops = process_model_startup(task->event_ctx, "single"); + if (!model_ops) goto failed; + status = dcesrv_init_context(task->event_ctx, task->lp_ctx, lp_dcerpc_endpoint_servers(task->lp_ctx), @@ -702,7 +709,7 @@ static void dcesrv_task_init(struct task_server *task) } for (e=dce_ctx->endpoint_list;e;e=e->next) { - status = dcesrv_add_ep(dce_ctx, task->lp_ctx, e, task->event_ctx, task->model_ops); + status = dcesrv_add_ep(dce_ctx, task->lp_ctx, e, task->event_ctx, model_ops); if (!NT_STATUS_IS_OK(status)) goto failed; } -- cgit