summaryrefslogtreecommitdiff
path: root/source3/rpcclient
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-04-19 23:27:35 +0200
committerVolker Lendecke <vl@samba.org>2008-04-20 00:14:26 +0200
commite1102b8f48aeebe7d4e730d2b432a1503b425210 (patch)
tree3179083bb844b6537f3a88c1df2100f51fb6fc81 /source3/rpcclient
parent9048cafbeaf82d1916de6538024fd660612dd25f (diff)
downloadsamba-e1102b8f48aeebe7d4e730d2b432a1503b425210.tar.gz
samba-e1102b8f48aeebe7d4e730d2b432a1503b425210.tar.bz2
samba-e1102b8f48aeebe7d4e730d2b432a1503b425210.zip
Introduce rpccli_set_timeout()
Reduce dependency on "cli" member of rpc_pipe_client struct (This used to be commit 2e4c1ba38963cffe4c3f25ab24bc28975f2fc291)
Diffstat (limited to 'source3/rpcclient')
-rw-r--r--source3/rpcclient/cmd_netlogon.c10
-rw-r--r--source3/rpcclient/cmd_samr.c5
-rw-r--r--source3/rpcclient/rpcclient.c2
3 files changed, 10 insertions, 7 deletions
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index a30dd740e2..12d8cf3052 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -101,14 +101,15 @@ static WERROR cmd_netlogon_getanydcname(struct rpc_pipe_client *cli,
}
/* Make sure to wait for our DC's reply */
- old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
+ old_timeout = rpccli_set_timeout(cli, 30000); /* 30 seconds. */
+ rpccli_set_timeout(cli, MAX(old_timeout, 30000)); /* At least 30 sec */
status = rpccli_netr_GetAnyDCName(cli, mem_ctx,
cli->desthost,
argv[1],
&dcname,
&werr);
- cli_set_timeout(cli->cli, old_timeout);
+ rpccli_set_timeout(cli, old_timeout);
if (!NT_STATUS_IS_OK(status)) {
return ntstatus_to_werror(status);
@@ -140,14 +141,15 @@ static WERROR cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
}
/* Make sure to wait for our DC's reply */
- old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
+ old_timeout = rpccli_set_timeout(cli, 30000); /* 30 seconds. */
+ rpccli_set_timeout(cli, MAX(30000, old_timeout)); /* At least 30 sec */
status = rpccli_netr_GetDcName(cli, mem_ctx,
cli->desthost,
argv[1],
&dcname,
&werr);
- cli_set_timeout(cli->cli, old_timeout);
+ rpccli_set_timeout(cli, old_timeout);
if (!NT_STATUS_IS_OK(status)) {
return ntstatus_to_werror(status);
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index e58354d0d3..4a820cd618 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -735,13 +735,14 @@ static NTSTATUS cmd_samr_query_groupmem(struct rpc_pipe_client *cli,
goto done;
/* Make sure to wait for our DC's reply */
- old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
+ old_timeout = rpccli_set_timeout(cli, 30000); /* 30 seconds. */
+ rpccli_set_timeout(cli, MAX(30000, old_timeout)); /* At least 30 sec */
result = rpccli_samr_QueryGroupMember(cli, mem_ctx,
&group_pol,
&rids);
- cli_set_timeout(cli->cli, old_timeout);
+ rpccli_set_timeout(cli, old_timeout);
if (!NT_STATUS_IS_OK(result))
goto done;
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 52dba2291b..8592e0a3b6 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -420,7 +420,7 @@ static NTSTATUS cmd_timeout(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
continue;
}
- cli_set_timeout(tmp_set->rpc_pipe->cli, timeout);
+ rpccli_set_timeout(tmp_set->rpc_pipe, timeout);
}
}
}