summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-25 04:38:57 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-25 04:38:57 +0200
commit5211755563bb2738c328d24a813d86c77eca048f (patch)
tree1f65534ecefb685d4c41cc42bd25b80fa45ab66d
parent928ecbaebbde00515d08fd530db7c99169c905ef (diff)
downloadsamba-5211755563bb2738c328d24a813d86c77eca048f.tar.gz
samba-5211755563bb2738c328d24a813d86c77eca048f.tar.bz2
samba-5211755563bb2738c328d24a813d86c77eca048f.zip
Expose request timeout variable in Python.
(This used to be commit daed1432d22f5fa78907ee0fef9def8802538150)
-rw-r--r--source4/librpc/rpc/pyrpc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c
index aebd484b49..a24c659a55 100644
--- a/source4/librpc/rpc/pyrpc.c
+++ b/source4/librpc/rpc/pyrpc.c
@@ -19,6 +19,7 @@
#include "includes.h"
#include <Python.h>
+#include <structmember.h>
#include "librpc/rpc/pyrpc.h"
#include "librpc/rpc/dcerpc.h"
#include "lib/events/events.h"
@@ -82,11 +83,18 @@ static PyObject *py_iface_server_name(PyObject *obj, void *closure)
}
static PyGetSetDef dcerpc_interface_getsetters[] = {
- { discard_const_p(char, "server_name"), py_iface_server_name, NULL,
+ { discard_const_p(char, "server_name"), py_iface_server_name, NULL,
discard_const_p(char, "name of the server, if connected over SMB") },
{ NULL }
};
+static PyMemberDef dcerpc_interface_members[] = {
+ { discard_const_p(char, "request_timeout"), T_INT,
+ offsetof(struct dcerpc_pipe, request_timeout), 0,
+ discard_const_p(char, "request timeout, in seconds") },
+ { NULL }
+};
+
void PyErr_SetDCERPCStatus(struct dcerpc_pipe *p, NTSTATUS status)
{
if (p != NULL && NT_STATUS_EQUAL(status, NT_STATUS_NET_WRITE_FAULT)) {
@@ -282,6 +290,7 @@ PyTypeObject dcerpc_InterfaceType = {
.tp_basicsize = sizeof(dcerpc_InterfaceObject),
.tp_dealloc = dcerpc_interface_dealloc,
.tp_getset = dcerpc_interface_getsetters,
+ .tp_members = dcerpc_interface_members,
.tp_methods = dcerpc_interface_methods,
.tp_doc = "ClientConnection(binding, syntax, lp_ctx=None, credentials=None) -> connection\n"
"\n"