diff options
author | Simo Sorce <idra@samba.org> | 2008-04-21 17:58:23 -0400 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-04-21 18:12:33 -0400 |
commit | 4e83011f72ba3df387512755a17760b42a7bf2f2 (patch) | |
tree | 8870bc1bf9181d3ed732db64324307fe533a07d6 /source4/libcli/raw | |
parent | 8a3e3391fb82c2ee8ef67dbded753d6fad564827 (diff) | |
download | samba-4e83011f72ba3df387512755a17760b42a7bf2f2.tar.gz samba-4e83011f72ba3df387512755a17760b42a7bf2f2.tar.bz2 samba-4e83011f72ba3df387512755a17760b42a7bf2f2.zip |
Remove more event_context_init() uses from function calls within deep down the code.
Make sure we pass around the event_context where we need it instead.
All test but a few python ones fail. Jelmer promised to fix them.
(This used to be commit 3045d391626fba169aa26be52174883e18d323e9)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r-- | source4/libcli/raw/clisocket.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c index 1dcf2d1c53..49838e8a1c 100644 --- a/source4/libcli/raw/clisocket.c +++ b/source4/libcli/raw/clisocket.c @@ -59,12 +59,7 @@ struct composite_context *smbcli_sock_connect_send(TALLOC_CTX *mem_ctx, if (result == NULL) goto failed; result->state = COMPOSITE_STATE_IN_PROGRESS; - if (event_ctx != NULL) { - result->event_ctx = talloc_reference(result, event_ctx); - } else { - result->event_ctx = event_context_init(result); - } - + result->event_ctx = talloc_reference(result, event_ctx); if (result->event_ctx == NULL) goto failed; state = talloc(result, struct sock_connect_state); @@ -202,6 +197,11 @@ _PUBLIC_ struct smbcli_socket *smbcli_sock_connect_byname(const char *host, cons TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx); struct smbcli_socket *result; + if (event_ctx == NULL) { + DEBUG(0, ("Invalid NULL event context passed in as parameter\n")); + return NULL; + } + if (tmp_ctx == NULL) { DEBUG(0, ("talloc_new failed\n")); return NULL; @@ -214,16 +214,6 @@ _PUBLIC_ struct smbcli_socket *smbcli_sock_connect_byname(const char *host, cons return NULL; } - if (event_ctx == NULL) { - event_ctx = event_context_init(mem_ctx); - } - - if (event_ctx == NULL) { - DEBUG(0, ("event_context_init failed\n")); - talloc_free(tmp_ctx); - return NULL; - } - /* allow hostnames of the form NAME#xx and do a netbios lookup */ if ((p = strchr(name, '#'))) { name_type = strtol(p+1, NULL, 16); |