summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client')
-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)