summaryrefslogtreecommitdiff
path: root/source4/libcli
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/libcli
parentb51c92a903877015acf268ab8ff0e07d3a82b295 (diff)
downloadsamba-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/libcli')
-rw-r--r--source4/libcli/cliconnect.c29
-rw-r--r--source4/libcli/libcli.h7
2 files changed, 14 insertions, 22 deletions
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c
index e25a400985..cdb04fb1f6 100644
--- a/source4/libcli/cliconnect.c
+++ b/source4/libcli/cliconnect.c
@@ -35,39 +35,32 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server,
struct tevent_context *ev_ctx,
struct resolve_context *resolve_ctx,
struct smbcli_options *options,
- const char *socket_options)
+ const char *socket_options,
+ struct nbt_name *calling,
+ struct nbt_name *called)
{
struct smbcli_socket *sock;
+ uint32_t timeout_msec = options->request_timeout * 1000;
+ NTSTATUS status;
sock = smbcli_sock_connect_byname(server, ports, NULL,
resolve_ctx, ev_ctx,
socket_options);
if (sock == NULL) return false;
-
- cli->transport = smbcli_transport_init(sock, cli, true, options);
- if (!cli->transport) {
- return false;
- }
-
- return true;
-}
-/* wrapper around smbcli_transport_connect() */
-bool smbcli_transport_establish(struct smbcli_state *cli,
- struct nbt_name *calling,
- struct nbt_name *called)
-{
- uint32_t timeout_msec = cli->transport->options.request_timeout * 1000;
- NTSTATUS status;
-
- status = smbcli_transport_connect(cli->transport->socket,
+ status = smbcli_transport_connect(sock,
timeout_msec,
calling, called);
if (!NT_STATUS_IS_OK(status)) {
return false;
}
+ cli->transport = smbcli_transport_init(sock, cli, true, options);
+ if (!cli->transport) {
+ return false;
+ }
+
return true;
}
diff --git a/source4/libcli/libcli.h b/source4/libcli/libcli.h
index 81a31d1933..9f661e3f4d 100644
--- a/source4/libcli/libcli.h
+++ b/source4/libcli/libcli.h
@@ -88,10 +88,9 @@ bool smbcli_socket_connect(struct smbcli_state *cli, const char *server,
struct tevent_context *ev_ctx,
struct resolve_context *resolve_ctx,
struct smbcli_options *options,
- const char *socket_options);
-bool smbcli_transport_establish(struct smbcli_state *cli,
- struct nbt_name *calling,
- struct nbt_name *called);
+ const char *socket_options,
+ struct nbt_name *calling,
+ struct nbt_name *called);
NTSTATUS smbcli_negprot(struct smbcli_state *cli, bool unicode, int maxprotocol);
NTSTATUS smbcli_session_setup(struct smbcli_state *cli,
struct cli_credentials *credentials,