1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

s3:pylibsmb: add settimeout()

BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Stefan Metzmacher 2018-12-19 15:18:17 +01:00 committed by Jeremy Allison
parent e27b62762d
commit deb0c2bdcb

View File

@ -656,6 +656,20 @@ static void py_cli_state_dealloc(struct py_cli_state *self)
Py_TYPE(self)->tp_free((PyObject *)self);
}
static PyObject *py_cli_settimeout(struct py_cli_state *self, PyObject *args)
{
unsigned int nmsecs = 0;
unsigned int omsecs = 0;
if (!PyArg_ParseTuple(args, "I", &nmsecs)) {
return NULL;
}
omsecs = cli_set_timeout(self->cli, nmsecs);
return PyInt_FromLong(omsecs);
}
static PyObject *py_cli_create(struct py_cli_state *self, PyObject *args,
PyObject *kwds)
{
@ -951,6 +965,8 @@ static PyObject *py_cli_list(struct py_cli_state *self,
}
static PyMethodDef py_cli_state_methods[] = {
{ "settimeout", (PyCFunction)py_cli_settimeout, METH_VARARGS,
"settimeout(new_timeout_msecs) => return old_timeout_msecs" },
{ "create", (PyCFunction)py_cli_create, METH_VARARGS|METH_KEYWORDS,
"Open a file" },
{ "close", (PyCFunction)py_cli_close, METH_VARARGS,