r13923: make the state_flags per dcesrv_connection
authorStefan Metzmacher <metze@samba.org>
Tue, 7 Mar 2006 11:02:47 +0000 (11:02 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:52:24 +0000 (13:52 -0500)
this will may help with a generic named pipe solution

metze
(This used to be commit c6fa9bd15cdb096c3dfc7a4109d9298933981255)

source4/ntvfs/ipc/vfs_ipc.c
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h
source4/rpc_server/dcerpc_sock.c

index d5259bc9a61cf57ab0fe210e203455706df9ae14..ea4955d84e1ef3207cfc679b6a181b3168fc98a2 100644 (file)
@@ -227,6 +227,7 @@ static NTSTATUS ipc_open_generic(struct ntvfs_module_context *ntvfs,
                                                ep_description, 
                                                req->session->session_info,
                                                srv_conn,
+                                               0,
                                                &p->dce_conn);
        if (!NT_STATUS_IS_OK(status)) {
                idr_remove(private->idtree_fnum, p->fnum);
index 29648b9e33de587291cc1bf07f9589959aeb976c..74f8dfe8d513911410d95f73bfa7502f56a737b3 100644 (file)
@@ -287,6 +287,7 @@ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx,
                                 TALLOC_CTX *mem_ctx,
                                 const struct dcesrv_endpoint *ep,
                                 struct stream_connection *srv_conn,
+                                uint32_t state_flags,
                                 struct dcesrv_connection **_p)
 {
        struct dcesrv_connection *p;
@@ -307,6 +308,7 @@ NTSTATUS dcesrv_endpoint_connect(struct dcesrv_context *dce_ctx,
        p->auth_state.session_key = dcesrv_generic_session_key;
        p->srv_conn = srv_conn;
        p->processing = False;
+       p->state_flags = state_flags;
 
        talloc_set_destructor(p, dcesrv_endpoint_destructor);
 
@@ -322,6 +324,7 @@ NTSTATUS dcesrv_endpoint_search_connect(struct dcesrv_context *dce_ctx,
                                        const struct dcerpc_binding *ep_description,
                                        struct auth_session_info *session_info,
                                        struct stream_connection *srv_conn,
+                                       uint32_t state_flags,
                                        struct dcesrv_connection **dce_conn_p)
 {
        NTSTATUS status;
@@ -333,7 +336,7 @@ NTSTATUS dcesrv_endpoint_search_connect(struct dcesrv_context *dce_ctx,
                return NT_STATUS_OBJECT_NAME_NOT_FOUND;
        }
 
-       status = dcesrv_endpoint_connect(dce_ctx, mem_ctx, ep, srv_conn, dce_conn_p);
+       status = dcesrv_endpoint_connect(dce_ctx, mem_ctx, ep, srv_conn, state_flags, dce_conn_p);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
        }
@@ -724,7 +727,7 @@ static NTSTATUS dcesrv_request(struct dcesrv_call_state *call)
        struct dcesrv_connection_context *context;
 
        call->fault_code        = 0;
-       call->state_flags       = call->conn->dce_ctx->state_flags;
+       call->state_flags       = call->conn->state_flags;
        call->time              = timeval_current();
 
        /* if authenticated, and the mech we use can't do async replies, don't use them... */
@@ -1134,7 +1137,7 @@ NTSTATUS dcesrv_output(struct dcesrv_connection *dce_conn,
        return status;
 }
 
-static NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx, const char **endpoint_servers, uint32_t state_flags, struct dcesrv_context **_dce_ctx)
+static NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx, const char **endpoint_servers, struct dcesrv_context **_dce_ctx)
 {
        NTSTATUS status;
        struct dcesrv_context *dce_ctx;
@@ -1148,7 +1151,6 @@ static NTSTATUS dcesrv_init_context(TALLOC_CTX *mem_ctx, const char **endpoint_s
        dce_ctx = talloc(mem_ctx, struct dcesrv_context);
        NT_STATUS_HAVE_NO_MEMORY(dce_ctx);
        dce_ctx->endpoint_list  = NULL;
-       dce_ctx->state_flags    = state_flags;
 
        for (i=0;endpoint_servers[i];i++) {
                const struct dcesrv_endpoint_server *ep_server;
@@ -1179,7 +1181,7 @@ NTSTATUS dcesrv_init_ipc_context(TALLOC_CTX *mem_ctx, struct dcesrv_context **_d
        NTSTATUS status;
        struct dcesrv_context *dce_ctx;
 
-       status = dcesrv_init_context(mem_ctx, lp_dcerpc_endpoint_servers(), 0, &dce_ctx);
+       status = dcesrv_init_context(mem_ctx, lp_dcerpc_endpoint_servers(), &dce_ctx);
        NT_STATUS_NOT_OK_RETURN(status);
 
        *_dce_ctx = dce_ctx;
@@ -1278,7 +1280,6 @@ static NTSTATUS dcesrv_init(struct event_context *event_context, const struct mo
 
        status = dcesrv_init_context(event_context,
                                     lp_dcerpc_endpoint_servers(),
-                                    DCESRV_CALL_STATE_FLAG_MAY_ASYNC,
                                     &dce_ctx);
        NT_STATUS_NOT_OK_RETURN(status);
 
index d6111c51efcab092f2e2bec4438bf1905f87b311..85449c1a602379ebcf32b8e4d2b27d9003a0c224 100644 (file)
@@ -177,6 +177,10 @@ struct dcesrv_connection {
        DATA_BLOB transport_session_key;
 
        BOOL processing;
+
+       /* this is the default state_flags for dcesrv_call_state structs */
+       uint32_t state_flags;
+
 };
 
 
@@ -220,9 +224,6 @@ struct dcesrv_context {
                        struct dcesrv_interface iface;
                } *interface_list;
        } *endpoint_list;
-
-       /* this is the default state_flags for dcesrv_call_state structs */
-       uint32_t state_flags;
 };
 
 /* this structure is used by modules to determine the size of some critical types */
index d8dd8b26209485f96ef5b24b229420a66303ad63..540332299dce3b5147e39748b8feb1cae9b4cf61 100644 (file)
@@ -67,6 +67,7 @@ static void dcesrv_sock_accept(struct stream_connection *srv_conn)
                                         srv_conn,
                                         dcesrv_sock->endpoint,
                                         srv_conn,
+                                        DCESRV_CALL_STATE_FLAG_MAY_ASYNC,
                                         &dcesrv_conn);
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0,("dcesrv_sock_accept: dcesrv_endpoint_connect failed: %s\n",