diff options
author | Andrew Bartlett <abartlet@samba.org> | 2016-07-09 16:36:52 +1200 |
---|---|---|
committer | Garming Sam <garming@samba.org> | 2016-07-12 23:24:13 +0200 |
commit | 2d3fdc0a45b7acae64b90ab701fcec170c4da07d (patch) | |
tree | f213c6b1df8a6f037f71b3b7941b2e99a296cdc4 /source4/librpc | |
parent | cea4a4b9b22c78f9736e2290d302a88644db4031 (diff) | |
download | samba-2d3fdc0a45b7acae64b90ab701fcec170c4da07d.tar.gz |
pyrpc: Allow control of RPC timeout for IRPC
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/rpc/pyrpc_util.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source4/librpc/rpc/pyrpc_util.c b/source4/librpc/rpc/pyrpc_util.c index b74eb4c944e..a9807a891ba 100644 --- a/source4/librpc/rpc/pyrpc_util.c +++ b/source4/librpc/rpc/pyrpc_util.c @@ -99,11 +99,12 @@ PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, Py const char *binding_string; PyObject *py_lp_ctx = Py_None, *py_credentials = Py_None, *py_basis = Py_None; NTSTATUS status; + unsigned int timeout = (unsigned int)-1; const char *kwnames[] = { - "binding", "lp_ctx", "credentials", "basis_connection", NULL + "binding", "lp_ctx", "credentials", "timeout", "basis_connection", NULL }; - if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|OOO:samr", discard_const_p(char *, kwnames), &binding_string, &py_lp_ctx, &py_credentials, &py_basis)) { + if (!PyArg_ParseTupleAndKeywords(args, kwargs, "s|OOIO:samr", discard_const_p(char *, kwnames), &binding_string, &py_lp_ctx, &py_credentials, &timeout, &py_basis)) { return NULL; } @@ -231,6 +232,12 @@ PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, Py ret->pipe->conn->flags |= DCERPC_NDR_REF_ALLOC; ret->binding_handle = ret->pipe->binding_handle; } + + /* reset timeout for the handle */ + if (timeout != ((unsigned int)-1)) { + dcerpc_binding_handle_set_timeout(ret->binding_handle, timeout); + } + return (PyObject *)ret; } |