r24032: It helps testing tremendously if the cluster messaging actually sends
authorVolker Lendecke <vlendec@samba.org>
Tue, 24 Jul 2007 11:47:37 +0000 (11:47 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:28:58 +0000 (12:28 -0500)
and receives messages to other nodes... :-)
(This used to be commit 3e9e9a3f28763500a1c5e551a808a14661d7d9fa)

source3/lib/messages.c
source3/lib/messages_ctdbd.c

index a7925ace7ae053dba62dc0d4a47e592f027339a3..c153953fb70e1c0b308d078fe3cf91899cf431ac 100644 (file)
@@ -320,6 +320,13 @@ NTSTATUS messaging_send(struct messaging_context *msg_ctx,
                        struct server_id server, uint32_t msg_type,
                        const DATA_BLOB *data)
 {
+#ifdef CLUSTER_SUPPORT
+       if (!procid_is_local(&server)) {
+               return msg_ctx->remote->send_fn(msg_ctx, server,
+                                               msg_type, data,
+                                               msg_ctx->remote);
+       }
+#endif
        return msg_ctx->local->send_fn(msg_ctx, server, msg_type, data,
                                       msg_ctx->local);
 }
index d048bc9abae1c097557182181cd75f76ed6370cf..dbdc8db3c1e022110a22acb1f93af3a0ed912748 100644 (file)
@@ -94,6 +94,15 @@ NTSTATUS messaging_ctdbd_init(struct messaging_context *msg_ctx,
                return status;
        }
 
+       status = ctdbd_register_msg_ctx(ctx->conn, msg_ctx);
+
+       if (!NT_STATUS_IS_OK(status)) {
+               DEBUG(10, ("ctdbd_register_msg_ctx failed: %s\n",
+                          nt_errstr(status)));
+               TALLOC_FREE(result);
+               return status;
+       }
+
        global_ctdbd_connection = ctx->conn;
        talloc_set_destructor(ctx, messaging_ctdbd_destructor);