summaryrefslogtreecommitdiff
path: root/source4/lib/messaging
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-02-08 02:59:58 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:44:50 -0500
commita2eff69b4b26ba6b3227b4bbe4557bc9b618d400 (patch)
treeebf8c7ad5a3e1ee8fbd6e7244e747852f1eea4e2 /source4/lib/messaging
parentaa40cc408b7b50f265913b5107932e237ce032a6 (diff)
downloadsamba-a2eff69b4b26ba6b3227b4bbe4557bc9b618d400.tar.gz
samba-a2eff69b4b26ba6b3227b4bbe4557bc9b618d400.tar.bz2
samba-a2eff69b4b26ba6b3227b4bbe4557bc9b618d400.zip
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)
Diffstat (limited to 'source4/lib/messaging')
-rw-r--r--source4/lib/messaging/messaging.c18
1 files changed, 9 insertions, 9 deletions
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);