summaryrefslogtreecommitdiff
path: root/source4/libcli
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2007-12-03 21:25:06 +0100
committerStefan Metzmacher <metze@samba.org>2007-12-21 05:47:42 +0100
commit2f8dc4f48f1802baa3405e7803563f6840e0d1b3 (patch)
treea479c7df067cb698134616bc6be8fa2fd76c7452 /source4/libcli
parentc9f0011bc57e6536f4ec130784d15609e71aa694 (diff)
downloadsamba-2f8dc4f48f1802baa3405e7803563f6840e0d1b3.tar.gz
samba-2f8dc4f48f1802baa3405e7803563f6840e0d1b3.tar.bz2
samba-2f8dc4f48f1802baa3405e7803563f6840e0d1b3.zip
r26266: Remove more global_loadparm uses.
(This used to be commit 99113075c4a96679bcec4f4d6bba4acb3dee4245)
Diffstat (limited to 'source4/libcli')
-rw-r--r--source4/libcli/cliconnect.c10
-rw-r--r--source4/libcli/ldap/ldap_client.c3
-rw-r--r--source4/libcli/raw/clisocket.c3
-rw-r--r--source4/libcli/raw/clitransport.c8
-rw-r--r--source4/libcli/smb2/connect.c6
-rw-r--r--source4/libcli/smb_composite/connect.c4
6 files changed, 23 insertions, 11 deletions
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c
index 39f97f4d8c..b9fd06db1a 100644
--- a/source4/libcli/cliconnect.c
+++ b/source4/libcli/cliconnect.c
@@ -30,15 +30,19 @@
/*
wrapper around smbcli_sock_connect()
*/
-bool smbcli_socket_connect(struct smbcli_state *cli, const char *server)
+bool smbcli_socket_connect(struct smbcli_state *cli, const char *server,
+ const char **name_resolve_order,
+ int max_xmit, int max_mux)
{
struct smbcli_socket *sock;
- sock = smbcli_sock_connect_byname(server, 0, NULL, NULL);
+ sock = smbcli_sock_connect_byname(server, 0, NULL, name_resolve_order,
+ NULL);
if (sock == NULL) return false;
- cli->transport = smbcli_transport_init(sock, cli, true);
+ cli->transport = smbcli_transport_init(sock, cli, true, max_xmit,
+ max_mux);
if (!cli->transport) {
return false;
}
diff --git a/source4/libcli/ldap/ldap_client.c b/source4/libcli/ldap/ldap_client.c
index f1cfaad18b..2fe0c78555 100644
--- a/source4/libcli/ldap/ldap_client.c
+++ b/source4/libcli/ldap/ldap_client.c
@@ -377,7 +377,8 @@ struct composite_context *ldap_connect_send(struct ldap_connection *conn,
return NULL;
}
-static void ldap_connect_got_sock(struct composite_context *ctx, struct ldap_connection *conn)
+static void ldap_connect_got_sock(struct composite_context *ctx,
+ struct ldap_connection *conn)
{
/* setup a handler for events on this socket */
conn->event.fde = event_add_fd(conn->event.event_ctx, conn->sock,
diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c
index e3420313c5..6e12d8073d 100644
--- a/source4/libcli/raw/clisocket.c
+++ b/source4/libcli/raw/clisocket.c
@@ -199,6 +199,7 @@ resolve a hostname and connect
****************************************************************************/
struct smbcli_socket *smbcli_sock_connect_byname(const char *host, int port,
TALLOC_CTX *mem_ctx,
+ const char **name_resolve_order,
struct event_context *event_ctx)
{
int name_type = NBT_NAME_SERVER;
@@ -239,7 +240,7 @@ struct smbcli_socket *smbcli_sock_connect_byname(const char *host, int port,
make_nbt_name(&nbt_name, host, name_type);
- status = resolve_name(&nbt_name, tmp_ctx, &address, event_ctx, lp_name_resolve_order(global_loadparm));
+ status = resolve_name(&nbt_name, tmp_ctx, &address, event_ctx, name_resolve_order);
if (!NT_STATUS_IS_OK(status)) {
talloc_free(tmp_ctx);
return NULL;
diff --git a/source4/libcli/raw/clitransport.c b/source4/libcli/raw/clitransport.c
index 0bf805910e..11df6c6c96 100644
--- a/source4/libcli/raw/clitransport.c
+++ b/source4/libcli/raw/clitransport.c
@@ -73,7 +73,9 @@ static NTSTATUS smbcli_transport_finish_recv(void *private, DATA_BLOB blob);
*/
struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
TALLOC_CTX *parent_ctx,
- bool primary)
+ bool primary,
+ int max_xmit,
+ int max_mux)
{
struct smbcli_transport *transport;
@@ -88,8 +90,8 @@ struct smbcli_transport *smbcli_transport_init(struct smbcli_socket *sock,
transport->negotiate.protocol = PROTOCOL_NT1;
transport->options.use_spnego = lp_use_spnego(global_loadparm) &&
lp_nt_status_support(global_loadparm);
- transport->options.max_xmit = lp_max_xmit(global_loadparm);
- transport->options.max_mux = lp_maxmux(global_loadparm);
+ transport->options.max_xmit = max_xmit;
+ transport->options.max_mux = max_mux;
transport->options.request_timeout = SMB_REQUEST_TIMEOUT;
transport->negotiate.max_xmit = transport->options.max_xmit;
diff --git a/source4/libcli/smb2/connect.c b/source4/libcli/smb2/connect.c
index 6f05d56cd4..7cfaf59a65 100644
--- a/source4/libcli/smb2/connect.c
+++ b/source4/libcli/smb2/connect.c
@@ -163,6 +163,7 @@ static void continue_resolve(struct composite_context *creq)
struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
const char *host,
const char *share,
+ const char **name_resolve_order,
struct cli_credentials *credentials,
struct event_context *ev)
{
@@ -187,8 +188,7 @@ struct composite_context *smb2_connect_send(TALLOC_CTX *mem_ctx,
ZERO_STRUCT(name);
name.name = host;
- creq = resolve_name_send(&name, c->event_ctx,
- lp_name_resolve_order(global_loadparm));
+ creq = resolve_name_send(&name, c->event_ctx, name_resolve_order);
composite_continue(c, creq, continue_resolve, c);
return c;
}
@@ -215,11 +215,13 @@ NTSTATUS smb2_connect_recv(struct composite_context *c, TALLOC_CTX *mem_ctx,
*/
NTSTATUS smb2_connect(TALLOC_CTX *mem_ctx,
const char *host, const char *share,
+ const char **name_resolve_order,
struct cli_credentials *credentials,
struct smb2_tree **tree,
struct event_context *ev)
{
struct composite_context *c = smb2_connect_send(mem_ctx, host, share,
+ name_resolve_order,
credentials, ev);
return smb2_connect_recv(c, mem_ctx, tree);
}
diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c
index 0238d5c550..9579cd20b5 100644
--- a/source4/libcli/smb_composite/connect.c
+++ b/source4/libcli/smb_composite/connect.c
@@ -307,7 +307,9 @@ static NTSTATUS connect_socket(struct composite_context *c,
NT_STATUS_NOT_OK_RETURN(status);
/* the socket is up - we can initialise the smbcli transport layer */
- state->transport = smbcli_transport_init(state->sock, state, true);
+ state->transport = smbcli_transport_init(state->sock, state, true,
+ lp_max_xmit(global_loadparm),
+ lp_maxmux(global_loadparm));
NT_STATUS_HAVE_NO_MEMORY(state->transport);
if (is_ipaddress(state->sock->hostname) &&