diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-01-23 09:01:46 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:09:07 -0500 |
commit | 9d6e923aab2036d6ce72e31aa4633d55b5991558 (patch) | |
tree | 6ac43ee304d491dd676220bda20f086c885ba8bc /source4/libcli/raw | |
parent | 0e9c55e70f7720d1c424867bd8054859847e84fa (diff) | |
download | samba-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/raw')
-rw-r--r-- | source4/libcli/raw/clisocket.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c index cbbd6490bd..9249f453e8 100644 --- a/source4/libcli/raw/clisocket.c +++ b/source4/libcli/raw/clisocket.c @@ -49,8 +49,10 @@ static int smbcli_sock_destructor(void *ptr) /* create a smbcli_socket context + The event_ctx is optional - if not supplied one will be created */ -struct smbcli_socket *smbcli_sock_init(TALLOC_CTX *mem_ctx) +struct smbcli_socket *smbcli_sock_init(TALLOC_CTX *mem_ctx, + struct event_context *event_ctx) { struct smbcli_socket *sock; @@ -59,7 +61,11 @@ struct smbcli_socket *smbcli_sock_init(TALLOC_CTX *mem_ctx) return NULL; } - sock->event.ctx = event_context_init(sock); + if (event_ctx) { + sock->event.ctx = talloc_reference(sock, event_ctx); + } else { + sock->event.ctx = event_context_init(sock); + } if (sock->event.ctx == NULL) { talloc_free(sock); return NULL; |