svn commit: samba r22232 - in
branches/SAMBA_4_0/source/cluster/ctdb: . common include
tridge at samba.org
tridge at samba.org
Mon Apr 16 00:29:16 GMT 2007
Author: tridge
Date: 2007-04-16 00:29:13 +0000 (Mon, 16 Apr 2007)
New Revision: 22232
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22232
Log:
add a special message handler ID meaning "all messages please"
This better fits the way Samba4 does message dispatch
Modified:
branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_message.c
branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c
branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h
Changeset:
Modified: branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_message.c
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_message.c 2007-04-16 00:18:54 UTC (rev 22231)
+++ branches/SAMBA_4_0/source/cluster/ctdb/common/ctdb_message.c 2007-04-16 00:29:13 UTC (rev 22232)
@@ -39,7 +39,7 @@
/* XXX we need a must faster way of finding the matching srvid
- maybe a tree? */
for (ml=ctdb->message_list;ml;ml=ml->next) {
- if (ml->srvid == srvid) break;
+ if (ml->srvid == srvid || ml->srvid == CTDB_SRVID_ALL) break;
}
if (ml == NULL) {
printf("daemon vnn:%d no msg handler for srvid=%u\n", ctdb_get_vnn(ctdb), srvid);
Modified: branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c 2007-04-16 00:18:54 UTC (rev 22231)
+++ branches/SAMBA_4_0/source/cluster/ctdb/ctdb_cluster.c 2007-04-16 00:29:13 UTC (rev 22232)
@@ -144,8 +144,8 @@
int ret;
/* setup messaging handler */
- ret = ctdb_set_message_handler(state->ctdb, ctdb_message_handler,
- server.id, state);
+ ret = ctdb_set_message_handler(state->ctdb, CTDB_SRVID_ALL,
+ ctdb_message_handler, state);
if (ret == -1) {
DEBUG(0,("ctdb_set_message_handler failed - %s\n",
ctdb_errstr(state->ctdb)));
Modified: branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h
===================================================================
--- branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h 2007-04-16 00:18:54 UTC (rev 22231)
+++ branches/SAMBA_4_0/source/cluster/ctdb/include/ctdb.h 2007-04-16 00:29:13 UTC (rev 22232)
@@ -56,6 +56,11 @@
#define CTDB_FLAG_CONNECT_WAIT (1<<2)
+/*
+ a message handler ID meaning "give me all messages"
+ */
+#define CTDB_SRVID_ALL 0xFFFFFFFF
+
struct event_context;
/*
More information about the samba-cvs
mailing list