diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-03-11 18:53:35 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-03-13 10:34:22 +0100 |
commit | 38be8c24fc25933cb5bccaedfd8320b1cdac73ab (patch) | |
tree | 0cb4f9ca77a59a021122718348bc3348e18a913b | |
parent | f84d439ff6e20859438506b31dd08828f6becbb7 (diff) | |
download | samba-38be8c24fc25933cb5bccaedfd8320b1cdac73ab.tar.gz samba-38be8c24fc25933cb5bccaedfd8320b1cdac73ab.tar.bz2 samba-38be8c24fc25933cb5bccaedfd8320b1cdac73ab.zip |
s4:rpc_server/remote: use dcerpc_binding_handle_call_*() instead of dcerpc_ndr_request_*()
metze
-rw-r--r-- | source4/rpc_server/remote/dcesrv_remote.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c index bdb3693335..4aa1a95fdd 100644 --- a/source4/rpc_server/remote/dcesrv_remote.c +++ b/source4/rpc_server/remote/dcesrv_remote.c @@ -21,6 +21,7 @@ */ #include "includes.h" +#include <tevent.h> #include "rpc_server/dcerpc_server.h" #include "auth/auth.h" #include "auth/credentials/credentials.h" @@ -177,7 +178,7 @@ static NTSTATUS remote_op_ndr_pull(struct dcesrv_call_state *dce_call, TALLOC_CT return NT_STATUS_OK; } -static void remote_op_dispatch_done(struct rpc_request *rreq); +static void remote_op_dispatch_done(struct tevent_req *subreq); static NTSTATUS remote_op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, void *r) { @@ -187,7 +188,7 @@ static NTSTATUS remote_op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CT const struct ndr_interface_table *table = dce_call->context->iface->private_data; const struct ndr_interface_call *call; const char *name; - struct rpc_request *rreq; + struct tevent_req *subreq; name = table->calls[opnum].name; call = &table->calls[opnum]; @@ -199,21 +200,23 @@ static NTSTATUS remote_op_dispatch(struct dcesrv_call_state *dce_call, TALLOC_CT priv->c_pipe->conn->flags |= DCERPC_NDR_REF_ALLOC; /* we didn't use the return code of this function as we only check the last_fault_code */ - rreq = dcerpc_ndr_request_send(priv->c_pipe, NULL, table, opnum, true, mem_ctx, r); - if (rreq == NULL) { - DEBUG(0,("dcesrv_remote: call[%s] dcerpc_ndr_request_send() failed!\n", name)); + subreq = dcerpc_binding_handle_call_send(dce_call, dce_call->event_ctx, + priv->c_pipe->binding_handle, + NULL, table, + opnum, mem_ctx, r); + if (subreq == NULL) { + DEBUG(0,("dcesrv_remote: call[%s] dcerpc_binding_handle_call_send() failed!\n", name)); return NT_STATUS_NO_MEMORY; } - rreq->async.callback = remote_op_dispatch_done; - rreq->async.private_data = dce_call; + tevent_req_set_callback(subreq, remote_op_dispatch_done, dce_call); dce_call->state_flags |= DCESRV_CALL_STATE_FLAG_ASYNC; return NT_STATUS_OK; } -static void remote_op_dispatch_done(struct rpc_request *rreq) +static void remote_op_dispatch_done(struct tevent_req *subreq) { - struct dcesrv_call_state *dce_call = talloc_get_type_abort(rreq->async.private_data, + struct dcesrv_call_state *dce_call = tevent_req_callback_data(subreq, struct dcesrv_call_state); struct dcesrv_remote_private *priv = talloc_get_type_abort(dce_call->context->private_data, struct dcesrv_remote_private); @@ -227,7 +230,8 @@ static void remote_op_dispatch_done(struct rpc_request *rreq) call = &table->calls[opnum]; /* we didn't use the return code of this function as we only check the last_fault_code */ - status = dcerpc_ndr_request_recv(rreq); + status = dcerpc_binding_handle_call_recv(subreq); + TALLOC_FREE(subreq); dce_call->fault_code = priv->c_pipe->last_fault_code; if (dce_call->fault_code != 0) { |