summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-05-02 10:05:46 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-05-03 07:37:06 +0200
commit85eb4377dbc9e2d25e0ee2e358e785347b09f0a7 (patch)
tree6f9f20fc991926620678fba7df5aeb12b9241901 /source4/lib
parent8da8c36b53cc115f0d446b666fc24fc9423d808e (diff)
downloadsamba-85eb4377dbc9e2d25e0ee2e358e785347b09f0a7.tar.gz
samba-85eb4377dbc9e2d25e0ee2e358e785347b09f0a7.tar.bz2
samba-85eb4377dbc9e2d25e0ee2e358e785347b09f0a7.zip
s4:cluster Rename .id to .pid in server_id
This also changes some DEBUG messages to use cluster_id_string() rather than .id, to isolate them from this and other changes. Andrew Bartlett
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/messaging/messaging.c10
-rw-r--r--source4/lib/messaging/pymessaging.c12
2 files changed, 12 insertions, 10 deletions
diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c
index f9d63203f2..48c9c16fb9 100644
--- a/source4/lib/messaging/messaging.c
+++ b/source4/lib/messaging/messaging.c
@@ -109,9 +109,11 @@ static void irpc_handler(struct messaging_context *, void *,
static void ping_message(struct messaging_context *msg, void *private_data,
uint32_t msg_type, struct server_id src, DATA_BLOB *data)
{
- DEBUG(1,("INFO: Received PING message from server %u.%u [%.*s]\n",
- (unsigned int)src.node, (unsigned int)src.id, (int)data->length,
+ char *task_id = cluster_id_string(NULL, src);
+ DEBUG(1,("INFO: Received PING message from server %s [%.*s]\n",
+ task_id, (int)data->length,
data->data?(const char *)data->data:""));
+ talloc_free(task_id);
messaging_send(msg, src, MSG_PONG, data);
}
@@ -638,7 +640,7 @@ struct messaging_context *messaging_client_init(TALLOC_CTX *mem_ctx,
{
struct server_id id;
ZERO_STRUCT(id);
- id.id = random() % 0x10000000;
+ id.pid = random() % 0x10000000;
return messaging_init(mem_ctx, dir, id, ev);
}
/*
@@ -1312,7 +1314,7 @@ struct dcerpc_binding_handle *irpc_binding_handle_by_name(TALLOC_CTX *mem_ctx,
errno = EADDRNOTAVAIL;
return NULL;
}
- if (sids[0].id == 0) {
+ if (sids[0].pid == 0) {
talloc_free(sids);
errno = EADDRNOTAVAIL;
return NULL;
diff --git a/source4/lib/messaging/pymessaging.c b/source4/lib/messaging/pymessaging.c
index 358d205b53..017b6f91a2 100644
--- a/source4/lib/messaging/pymessaging.c
+++ b/source4/lib/messaging/pymessaging.c
@@ -45,12 +45,12 @@ static bool server_id_from_py(PyObject *object, struct server_id *server_id)
}
if (PyTuple_Size(object) == 3) {
- return PyArg_ParseTuple(object, "iii", &server_id->id, &server_id->id2, &server_id->node);
+ return PyArg_ParseTuple(object, "iii", &server_id->pid, &server_id->id2, &server_id->node);
} else {
- int id, id2;
- if (!PyArg_ParseTuple(object, "ii", &id, &id2))
+ int pid, id2;
+ if (!PyArg_ParseTuple(object, "ii", &pid, &id2))
return false;
- *server_id = cluster_id(id, id2);
+ *server_id = cluster_id(pid, id2);
return true;
}
}
@@ -159,7 +159,7 @@ static void py_msg_callback_wrapper(struct messaging_context *msg, void *private
PyObject *callback = (PyObject *)private_data;
PyObject_CallFunction(callback, discard_const_p(char, "i(iii)s#"), msg_type,
- server_id.id, server_id.id2, server_id.node,
+ server_id.pid, server_id.id2, server_id.node,
data->data, data->length);
}
@@ -229,7 +229,7 @@ static PyObject *py_messaging_server_id(PyObject *obj, void *closure)
messaging_Object *iface = (messaging_Object *)obj;
struct server_id server_id = messaging_get_server_id(iface->msg_ctx);
- return Py_BuildValue("(iii)", server_id.id, server_id.id2,
+ return Py_BuildValue("(iii)", server_id.pid, server_id.id2,
server_id.node);
}