From 577218b2aded7adb367f3f33bcc5560f3d4c0ec2 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 10 Jan 2005 12:15:26 +0000 Subject: r4640: first stage in the server side support for multiple context_ids on one pipe this stage does the following: - simplifies the dcerpc_handle handling, and all the callers of it - split out the context_id depenent state into a linked list of established contexts - fixed some talloc handling in several rpc servers that i noticed while doing the above (This used to be commit fde042b3fc609c94e2c7eedcdd72ecdf489cf63b) --- source4/rpc_server/drsuapi/dcesrv_drsuapi.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) (limited to 'source4/rpc_server/drsuapi') diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c index 5539c9117f..508a2dec5e 100644 --- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c +++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c @@ -26,14 +26,6 @@ #include "rpc_server/common/common.h" #include "rpc_server/drsuapi/dcesrv_drsuapi.h" -/* - destroy a general handle. -*/ -static void drsuapi_handle_destroy(struct dcesrv_connection *conn, struct dcesrv_handle *h) -{ - talloc_free(h->data); -} - /* drsuapi_DsBind */ @@ -57,14 +49,13 @@ static WERROR drsuapi_DsBind(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem return WERR_FOOBAR; } - handle = dcesrv_handle_new(dce_call->conn, DRSUAPI_BIND_HANDLE); + handle = dcesrv_handle_new(dce_call->context, DRSUAPI_BIND_HANDLE); if (!handle) { talloc_free(b_state); return WERR_NOMEM; } - handle->data = b_state; - handle->destroy = drsuapi_handle_destroy; + handle->data = talloc_steal(handle, b_state); bind_info = talloc_p(mem_ctx, struct drsuapi_DsBindInfoCtr); WERR_TALLOC_CHECK(bind_info); @@ -88,7 +79,7 @@ static WERROR drsuapi_DsBind(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem drsuapi_DsUnbind */ static WERROR drsuapi_DsUnbind(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, - struct drsuapi_DsUnbind *r) + struct drsuapi_DsUnbind *r) { struct dcesrv_handle *h; @@ -96,10 +87,7 @@ static WERROR drsuapi_DsUnbind(struct dcesrv_call_state *dce_call, TALLOC_CTX *m DCESRV_PULL_HANDLE_WERR(h, r->in.bind_handle, DRSUAPI_BIND_HANDLE); - /* this causes the callback drsuapi_handle_destroy() to be called by - the handle destroy code which destroys the state associated - with the handle */ - dcesrv_handle_destroy(dce_call->conn, h); + talloc_free(h); ZERO_STRUCTP(r->out.bind_handle); -- cgit