From 4877be53df1181f75d603fa4edc67c34e1ba5141 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Wed, 30 Nov 2011 07:17:31 +0100 Subject: s4:libcli: move smbcli_transport_establish() logic into smbcli_socket_connect() metze --- source4/torture/basic/base.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source4/torture/basic') diff --git a/source4/torture/basic/base.c b/source4/torture/basic/base.c index 519ad406fe..d1005d0bdc 100644 --- a/source4/torture/basic/base.c +++ b/source4/torture/basic/base.c @@ -40,6 +40,7 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx) struct smbcli_state *cli; const char *host = torture_setting_string(tctx, "host", NULL); struct smbcli_options options; + bool ok; make_nbt_name_client(&calling, lpcfg_netbios_name(tctx->lp_ctx)); @@ -53,18 +54,17 @@ static struct smbcli_state *open_nbt_connection(struct torture_context *tctx) lpcfg_smbcli_options(tctx->lp_ctx, &options); - if (!smbcli_socket_connect(cli, host, lpcfg_smb_ports(tctx->lp_ctx), tctx->ev, - lpcfg_resolve_context(tctx->lp_ctx), &options, - lpcfg_socket_options(tctx->lp_ctx))) { + ok = smbcli_socket_connect(cli, host, lpcfg_smb_ports(tctx->lp_ctx), + tctx->ev, + lpcfg_resolve_context(tctx->lp_ctx), + &options, + lpcfg_socket_options(tctx->lp_ctx), + &calling, &called); + if (!ok) { torture_comment(tctx, "Failed to connect with %s\n", host); goto failed; } - if (!smbcli_transport_establish(cli, &calling, &called)) { - torture_comment(tctx, "%s rejected the session\n",host); - goto failed; - } - return cli; failed: -- cgit