diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-11-30 07:17:31 +0100 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-11-30 13:41:08 +0100 |
commit | 4877be53df1181f75d603fa4edc67c34e1ba5141 (patch) | |
tree | abc8c5f1a71ce84cfbd8b50ac4489d82f8e78e06 /source4/client | |
parent | b51c92a903877015acf268ab8ff0e07d3a82b295 (diff) | |
download | samba-4877be53df1181f75d603fa4edc67c34e1ba5141.tar.gz samba-4877be53df1181f75d603fa4edc67c34e1ba5141.tar.bz2 samba-4877be53df1181f75d603fa4edc67c34e1ba5141.zip |
s4:libcli: move smbcli_transport_establish() logic into smbcli_socket_connect()
metze
Diffstat (limited to 'source4/client')
-rw-r--r-- | source4/client/client.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/source4/client/client.c b/source4/client/client.c index 57686bb7ba..d7adc41ca1 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -3184,6 +3184,7 @@ static int do_message_op(const char *netbios_name, const char *desthost, struct nbt_name called, calling; const char *server_name; struct smbcli_state *cli; + bool ok; make_nbt_name_client(&calling, netbios_name); @@ -3191,17 +3192,18 @@ static int do_message_op(const char *netbios_name, const char *desthost, server_name = destip ? destip : desthost; - if (!(cli = smbcli_state_init(NULL)) || - !smbcli_socket_connect(cli, server_name, destports, - ev_ctx, resolve_ctx, options, - socket_options)) { - d_printf("Connection to %s failed\n", server_name); + cli = smbcli_state_init(NULL); + if (cli == NULL) { + d_printf("smbcli_state_init() failed\n"); return 1; } - if (!smbcli_transport_establish(cli, &calling, &called)) { - d_printf("session request failed\n"); - talloc_free(cli); + ok = smbcli_socket_connect(cli, server_name, destports, + ev_ctx, resolve_ctx, options, + socket_options, + &calling, &called); + if (!ok) { + d_printf("Connection to %s failed\n", server_name); return 1; } |