Remove useless layer of indirection, where every service called
[jelmer/samba4-debian.git] / source / rpc_server / service_rpc.c
index 0483736912f81937449a01b0868158289db83442..ddcf1c2a999166172aec47e42e207786a3c57c26 100644 (file)
@@ -232,7 +232,8 @@ static NTSTATUS dcesrv_add_ep_unix(struct dcesrv_context *dce_ctx,
        dcesrv_sock->endpoint           = e;
        dcesrv_sock->dcesrv_ctx         = talloc_reference(dcesrv_sock, dce_ctx);
 
-       status = stream_setup_socket(event_ctx, model_ops, &dcesrv_stream_ops, 
+       status = stream_setup_socket(event_ctx, lp_ctx,
+                                    model_ops, &dcesrv_stream_ops, 
                                     "unix", e->ep_description->endpoint, &port, 
                                     lp_socket_options(lp_ctx), 
                                     dcesrv_sock);
@@ -271,7 +272,8 @@ static NTSTATUS dcesrv_add_ep_ncalrpc(struct dcesrv_context *dce_ctx,
        dcesrv_sock->endpoint           = e;
        dcesrv_sock->dcesrv_ctx         = talloc_reference(dcesrv_sock, dce_ctx);
 
-       status = stream_setup_socket(event_ctx, model_ops, &dcesrv_stream_ops, 
+       status = stream_setup_socket(event_ctx, lp_ctx,
+                                    model_ops, &dcesrv_stream_ops, 
                                     "unix", full_path, &port, 
                                     lp_socket_options(lp_ctx), 
                                     dcesrv_sock);
@@ -352,7 +354,8 @@ static NTSTATUS add_socket_rpc_tcp_iface(struct dcesrv_context *dce_ctx, struct
        dcesrv_sock->endpoint           = e;
        dcesrv_sock->dcesrv_ctx         = talloc_reference(dcesrv_sock, dce_ctx);
 
-       status = stream_setup_socket(event_ctx, model_ops, &dcesrv_stream_ops, 
+       status = stream_setup_socket(event_ctx, dce_ctx->lp_ctx,
+                                    model_ops, &dcesrv_stream_ops, 
                                     "ipv4", address, &port, 
                                     lp_socket_options(dce_ctx->lp_ctx), 
                                     dcesrv_sock);
@@ -454,20 +457,9 @@ failed:
        task_server_terminate(task, "Failed to startup dcerpc server task");    
 }
 
-/*
-  called on startup of the smb server service It's job is to start
-  listening on all configured sockets
-*/
-static NTSTATUS dcesrv_init(struct event_context *event_context, 
-                           struct loadparm_context *lp_ctx,
-                           const struct model_ops *model_ops)
-{      
-       return task_server_startup(event_context, model_ops, dcesrv_task_init);
-}
-
 NTSTATUS server_service_rpc_init(void)
 {
-       init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES, NULL };
+       init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES };
        init_module_fn *shared_init = load_samba_modules(NULL, global_loadparm, "dcerpc_server");
 
        run_init_functions(static_init);
@@ -475,5 +467,5 @@ NTSTATUS server_service_rpc_init(void)
 
        talloc_free(shared_init);
        
-       return register_server_service("rpc", dcesrv_init);
+       return register_server_service("rpc", dcesrv_task_init);
 }