diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-04-27 08:57:41 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-04-28 20:35:49 +0200 |
commit | 578cbf1139e5a09df6160ea9ee6766190c566893 (patch) | |
tree | d748de005968831e383c96a315a8a71dc68cc4ab /source4/librpc/rpc | |
parent | 2bb637d1cfa5147000d9c2cbbbafcbbb20df26da (diff) | |
download | samba-578cbf1139e5a09df6160ea9ee6766190c566893.tar.gz samba-578cbf1139e5a09df6160ea9ee6766190c566893.tar.bz2 samba-578cbf1139e5a09df6160ea9ee6766190c566893.zip |
s4:libcli/smb2: convert smb2_connect_*() to tevent_req
metze
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r-- | source4/librpc/rpc/dcerpc_connect.c | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c index 842ef43206..c236399b52 100644 --- a/source4/librpc/rpc/dcerpc_connect.c +++ b/source4/librpc/rpc/dcerpc_connect.c @@ -186,16 +186,18 @@ static void continue_pipe_open_smb2(struct composite_context *ctx) /* Stage 2 of ncacn_np_smb2: Open a named pipe after successful smb2 connection */ -static void continue_smb2_connect(struct composite_context *ctx) +static void continue_smb2_connect(struct tevent_req *subreq) { struct composite_context *open_req; - struct composite_context *c = talloc_get_type(ctx->async.private_data, - struct composite_context); + struct composite_context *c = + tevent_req_callback_data(subreq, + struct composite_context); struct pipe_np_smb2_state *s = talloc_get_type(c->private_data, struct pipe_np_smb2_state); /* receive result of smb2 connect request */ - c->status = smb2_connect_recv(ctx, c, &s->tree); + c->status = smb2_connect_recv(subreq, c, &s->tree); + TALLOC_FREE(subreq); if (!composite_is_ok(c)) return; /* prepare named pipe open parameters */ @@ -220,7 +222,7 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send( { struct composite_context *c; struct pipe_np_smb2_state *s; - struct composite_context *conn_req; + struct tevent_req *subreq; struct smbcli_options options; /* composite context allocation and setup */ @@ -247,17 +249,17 @@ static struct composite_context *dcerpc_pipe_connect_ncacn_np_smb2_send( lpcfg_smbcli_options(lp_ctx, &options); /* send smb2 connect request */ - conn_req = smb2_connect_send(mem_ctx, s->io.binding->host, + subreq = smb2_connect_send(s, c->event_ctx, + s->io.binding->host, lpcfg_parm_string_list(mem_ctx, lp_ctx, NULL, "smb2", "ports", NULL), - "IPC$", - s->io.resolve_ctx, - s->io.creds, - c->event_ctx, - &options, - lpcfg_socket_options(lp_ctx), - lpcfg_gensec_settings(mem_ctx, lp_ctx) - ); - composite_continue(c, conn_req, continue_smb2_connect, c); + "IPC$", + s->io.resolve_ctx, + s->io.creds, + &options, + lpcfg_socket_options(lp_ctx), + lpcfg_gensec_settings(mem_ctx, lp_ctx)); + if (composite_nomem(subreq, c)) return c; + tevent_req_set_callback(subreq, continue_smb2_connect, c); return c; } |