summaryrefslogtreecommitdiff
path: root/source4/libcli/composite
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2005-01-23 09:01:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:09:07 -0500
commit9d6e923aab2036d6ce72e31aa4633d55b5991558 (patch)
tree6ac43ee304d491dd676220bda20f086c885ba8bc /source4/libcli/composite
parent0e9c55e70f7720d1c424867bd8054859847e84fa (diff)
downloadsamba-9d6e923aab2036d6ce72e31aa4633d55b5991558.tar.gz
samba-9d6e923aab2036d6ce72e31aa4633d55b5991558.tar.bz2
samba-9d6e923aab2036d6ce72e31aa4633d55b5991558.zip
r4938: allow the caller to supply an existing event_context if they want to
in smb_composite_connect_send(). This makes doing parallel calls much easier. (This used to be commit 442308970c123b9fb25615673049e1c1c234a0b9)
Diffstat (limited to 'source4/libcli/composite')
-rw-r--r--source4/libcli/composite/connect.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/libcli/composite/connect.c b/source4/libcli/composite/connect.c
index 83f1dc4fa6..69b394310e 100644
--- a/source4/libcli/composite/connect.c
+++ b/source4/libcli/composite/connect.c
@@ -330,7 +330,8 @@ static void composite_handler(struct smbcli_composite *req)
/*
a function to establish a smbcli_tree from scratch
*/
-struct smbcli_composite *smb_composite_connect_send(struct smb_composite_connect *io)
+struct smbcli_composite *smb_composite_connect_send(struct smb_composite_connect *io,
+ struct event_context *event_ctx)
{
struct smbcli_composite *c;
struct connect_state *state;
@@ -342,14 +343,14 @@ struct smbcli_composite *smb_composite_connect_send(struct smb_composite_connect
state = talloc(c, struct connect_state);
if (state == NULL) goto failed;
- state->sock = smbcli_sock_init(state);
+ state->sock = smbcli_sock_init(state, event_ctx);
if (state->sock == NULL) goto failed;
state->io = io;
state->stage = CONNECT_RESOLVE;
c->state = SMBCLI_REQUEST_SEND;
- c->event_ctx = state->sock->event.ctx;
+ c->event_ctx = talloc_reference(c, state->sock->event.ctx);
c->private = state;
name.name = io->in.dest_host;
@@ -391,6 +392,6 @@ NTSTATUS smb_composite_connect_recv(struct smbcli_composite *c, TALLOC_CTX *mem_
*/
NTSTATUS smb_composite_connect(struct smb_composite_connect *io, TALLOC_CTX *mem_ctx)
{
- struct smbcli_composite *c = smb_composite_connect_send(io);
+ struct smbcli_composite *c = smb_composite_connect_send(io, NULL);
return smb_composite_connect_recv(c, mem_ctx);
}