summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-05-30 12:18:07 +0200
committerJelmer Vernooij <jelmer@samba.org>2008-05-30 12:18:07 +0200
commit5107f093c270f7a0dfc359de088b475fffc4e279 (patch)
tree99f616c6e352f87fbd41e60ad7fae3adf67e72fa /source4/lib
parent46f22add9ae03b95f4b22235c297737475427f41 (diff)
parentbe1927cd80838a6807827cef4431c03160d52582 (diff)
downloadsamba-5107f093c270f7a0dfc359de088b475fffc4e279.tar.gz
samba-5107f093c270f7a0dfc359de088b475fffc4e279.tar.bz2
samba-5107f093c270f7a0dfc359de088b475fffc4e279.zip
Merge branch 'v4-0-test' of ssh://git.samba.org/data/git/samba into v4-0-defs
Conflicts: source/samba4-skip (This used to be commit 7b0e0eb346c2f6a240b20fbcf14029539c6512b9)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/messaging/pymessaging.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c
index 1c22fb431a..41c9c82b1f 100644
--- a/source4/lib/messaging/pymessaging.c
+++ b/source4/lib/messaging/pymessaging.c
@@ -127,12 +127,15 @@ static PyObject *py_messaging_send(PyObject *self, PyObject *args, PyObject *kwa
NTSTATUS status;
struct server_id server;
const char *kwnames[] = { "target", "msg_type", "data", NULL };
+ int length;
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "Ois#|:send",
- discard_const_p(char *, kwnames), &target, &msg_type, &data.data, &data.length)) {
+ discard_const_p(char *, kwnames), &target, &msg_type, &data.data, &length)) {
return NULL;
}
+ data.length = length;
+
if (!server_id_from_py(target, &server))
return NULL;
@@ -159,11 +162,11 @@ static void py_msg_callback_wrapper(struct messaging_context *msg, void *private
static PyObject *py_messaging_register(PyObject *self, PyObject *args, PyObject *kwargs)
{
messaging_Object *iface = (messaging_Object *)self;
- uint32_t msg_type = -1;
+ int msg_type = -1;
PyObject *callback;
NTSTATUS status;
const char *kwnames[] = { "callback", "msg_type", NULL };
-
+
if (!PyArg_ParseTupleAndKeywords(args, kwargs, "O|i:send",
discard_const_p(char *, kwnames), &callback, &msg_type)) {
return NULL;
@@ -172,8 +175,10 @@ static PyObject *py_messaging_register(PyObject *self, PyObject *args, PyObject
Py_INCREF(callback);
if (msg_type == -1) {
+ uint32_t msg_type32 = msg_type;
status = messaging_register_tmp(iface->msg_ctx, callback,
- py_msg_callback_wrapper, &msg_type);
+ py_msg_callback_wrapper, &msg_type32);
+ msg_type = msg_type32;
} else {
status = messaging_register(iface->msg_ctx, callback,
msg_type, py_msg_callback_wrapper);
@@ -189,7 +194,7 @@ static PyObject *py_messaging_register(PyObject *self, PyObject *args, PyObject
static PyObject *py_messaging_deregister(PyObject *self, PyObject *args, PyObject *kwargs)
{
messaging_Object *iface = (messaging_Object *)self;
- uint32_t msg_type = -1;
+ int msg_type = -1;
PyObject *callback;
const char *kwnames[] = { "callback", "msg_type", NULL };