diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-07-30 18:36:17 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:15:14 -0500 |
commit | 5c1d8810911af7335bf299fbb871f7230ea7a717 (patch) | |
tree | 58d3b9723b829ad47a31c78abb70b307d6c22ba5 /source4/librpc/rpc/dcerpc_smb2.c | |
parent | 2ac4cdf85e0359840a232d1e6182dd1607acc22c (diff) | |
download | samba-5c1d8810911af7335bf299fbb871f7230ea7a717.tar.gz samba-5c1d8810911af7335bf299fbb871f7230ea7a717.tar.bz2 samba-5c1d8810911af7335bf299fbb871f7230ea7a717.zip |
r17326: make better usage of the composite api
metze
(This used to be commit 097c9f09f3b9b45f7b0386dfb02173c1515ed45c)
Diffstat (limited to 'source4/librpc/rpc/dcerpc_smb2.c')
-rw-r--r-- | source4/librpc/rpc/dcerpc_smb2.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/source4/librpc/rpc/dcerpc_smb2.c b/source4/librpc/rpc/dcerpc_smb2.c index f3d6f9fe0e..845884115c 100644 --- a/source4/librpc/rpc/dcerpc_smb2.c +++ b/source4/librpc/rpc/dcerpc_smb2.c @@ -371,13 +371,12 @@ struct composite_context *dcerpc_pipe_open_smb2_send(struct dcerpc_connection *c struct smb2_create io; struct smb2_request *req; - ctx = talloc_zero(NULL, struct composite_context); - if (ctx == NULL) goto failed; - ctx->state = COMPOSITE_STATE_IN_PROGRESS; - ctx->event_ctx = talloc_reference(c, c->event_ctx); + ctx = composite_create(c, c->event_ctx); + if (ctx == NULL) return NULL; state = talloc(ctx, struct pipe_open_smb2_state); - if (state == NULL) goto failed; + if (composite_nomem(state, ctx)) return ctx; + ctx->private_data = state; state->c = c; state->ctx = ctx; @@ -409,16 +408,8 @@ struct composite_context *dcerpc_pipe_open_smb2_send(struct dcerpc_connection *c io.in.fname = pipe_name; req = smb2_create_send(tree, &io); - if (req == NULL) goto failed; - - req->async.fn = pipe_open_recv; - req->async.private = state; - + composite_continue_smb2(ctx, req, pipe_open_recv, state); return ctx; - - failed: - talloc_free(ctx); - return NULL; } static void pipe_open_recv(struct smb2_request *req) |