summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2010-03-28 19:34:34 +0200
committerStefan Metzmacher <metze@samba.org>2010-03-29 18:11:17 +0200
commit3e70da3f470eeb122f95477fb48d89939f501b3e (patch)
tree7e049f44a43365dbe45024bd2552c23e86803e73
parent99664ad15460530b6fb44957b6c57823f09884bf (diff)
downloadsamba-3e70da3f470eeb122f95477fb48d89939f501b3e.tar.gz
samba-3e70da3f470eeb122f95477fb48d89939f501b3e.tar.bz2
samba-3e70da3f470eeb122f95477fb48d89939f501b3e.zip
s3:rpc_client: return at least 10 sec as old timeout in rpccli_set_timeout() instead of 0
metze
-rw-r--r--source3/rpc_client/cli_pipe.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 5ee6dcb2b5..8d33d7713f 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3064,18 +3064,27 @@ NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
return status;
}
+#define RPCCLI_DEFAULT_TIMEOUT 10000 /* 10 seconds. */
+
unsigned int rpccli_set_timeout(struct rpc_pipe_client *rpc_cli,
unsigned int timeout)
{
+ unsigned int old;
+
if (rpc_cli->transport == NULL) {
- return 0;
+ return RPCCLI_DEFAULT_TIMEOUT;
}
if (rpc_cli->transport->set_timeout == NULL) {
- return 0;
+ return RPCCLI_DEFAULT_TIMEOUT;
+ }
+
+ old = rpc_cli->transport->set_timeout(rpc_cli->transport->priv, timeout);
+ if (old == 0) {
+ return RPCCLI_DEFAULT_TIMEOUT;
}
- return rpc_cli->transport->set_timeout(rpc_cli->transport->priv, timeout);
+ return old;
}
bool rpccli_is_connected(struct rpc_pipe_client *rpc_cli)