summaryrefslogtreecommitdiff
path: root/source4/client
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2011-11-30 07:17:31 +0100
committerStefan Metzmacher <metze@samba.org>2011-11-30 13:41:08 +0100
commit4877be53df1181f75d603fa4edc67c34e1ba5141 (patch)
treeabc8c5f1a71ce84cfbd8b50ac4489d82f8e78e06 /source4/client
parentb51c92a903877015acf268ab8ff0e07d3a82b295 (diff)
downloadsamba-4877be53df1181f75d603fa4edc67c34e1ba5141.tar.gz
s4:libcli: move smbcli_transport_establish() logic into smbcli_socket_connect()
metze
Diffstat (limited to 'source4/client')
-rw-r--r--source4/client/client.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index 57686bb7baf..d7adc41ca1a 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;
}