diff options
author | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2011-06-24 16:26:23 +1000 |
commit | 6da26870e0ae5acd6ff49a30ec2f6886b44d095e (patch) | |
tree | 850c71039563c16a5d563c47e7ba2ab645baf198 /source4/librpc/rpc/dcerpc_connect.c | |
parent | 6925a799d04c6fa59dd2ddef1f5510f9bb7d17d1 (diff) | |
parent | 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 (diff) | |
download | samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.gz samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.tar.bz2 samba-6da26870e0ae5acd6ff49a30ec2f6886b44d095e.zip |
Merge 2610c05b5b95cc7036b3d6dfb894c6cfbdb68483 as Samba-4.0alpha16
Diffstat (limited to 'source4/librpc/rpc/dcerpc_connect.c')
-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; } |