1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s3:rpc_client: return at least 10 sec as old timeout in rpccli_set_timeout() instead of 0

metze
This commit is contained in:
Stefan Metzmacher 2010-03-28 19:34:34 +02:00
parent 99664ad154
commit 3e70da3f47

View File

@ -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;
}
return rpc_cli->transport->set_timeout(rpc_cli->transport->priv, timeout);
old = rpc_cli->transport->set_timeout(rpc_cli->transport->priv, timeout);
if (old == 0) {
return RPCCLI_DEFAULT_TIMEOUT;
}
return old;
}
bool rpccli_is_connected(struct rpc_pipe_client *rpc_cli)