From a2eff69b4b26ba6b3227b4bbe4557bc9b618d400 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 8 Feb 2007 02:59:58 +0000 Subject: r21233: first version of samba4 messaging using ctdb is working. This means we should now work on a real cluster, and not just a localhost simulator (This used to be commit f05072ad74fb08fd906bc500c5e89930bcc3387f) --- source4/lib/messaging/messaging.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'source4/lib/messaging') diff --git a/source4/lib/messaging/messaging.c b/source4/lib/messaging/messaging.c index a043937733..03bfb6b571 100644 --- a/source4/lib/messaging/messaging.c +++ b/source4/lib/messaging/messaging.c @@ -155,8 +155,7 @@ static void messaging_dispatch(struct messaging_context *msg, struct messaging_r /* handler for messages that arrive from other nodes in the cluster */ -static void cluster_message_handler(struct messaging_context *msg, struct server_id from, - uint32_t msg_type, DATA_BLOB packet) +static void cluster_message_handler(struct messaging_context *msg, DATA_BLOB packet) { struct messaging_rec *rec; @@ -165,7 +164,6 @@ static void cluster_message_handler(struct messaging_context *msg, struct server smb_panic("Unable to allocate messaging_rec"); } - talloc_steal(rec, packet.data); rec->msg = msg; rec->path = msg->path; rec->header = (struct messaging_header *)packet.data; @@ -406,12 +404,6 @@ NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server, NTSTATUS status; size_t dlength = data?data->length:0; - if (!cluster_node_equal(&msg->server_id, &server)) { - /* the destination is on another node - dispatch via - the cluster layer */ - return cluster_message_send(server, msg_type, data); - } - rec = talloc(msg, struct messaging_rec); if (rec == NULL) { return NT_STATUS_NO_MEMORY; @@ -435,6 +427,14 @@ NTSTATUS messaging_send(struct messaging_context *msg, struct server_id server, data->data, dlength); } + if (!cluster_node_equal(&msg->server_id, &server)) { + /* the destination is on another node - dispatch via + the cluster layer */ + status = cluster_message_send(server, msg_type, &rec->packet); + talloc_free(rec); + return status; + } + rec->path = messaging_path(msg, server); talloc_steal(rec, rec->path); -- cgit