diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-05-04 11:41:29 +1000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2007-05-04 11:41:29 +1000 |
commit | e752f3bd97bb2899ab67f424eb44d8f3ce0f8b62 (patch) | |
tree | 0c2915d6ffabb343cd7fc3e563793dfeb247fb09 /ctdb/common/ctdb_message.c | |
parent | 648e3835b3a27240c3f69ea2f9f7d0a58b54fc40 (diff) | |
download | samba-e752f3bd97bb2899ab67f424eb44d8f3ce0f8b62.tar.gz samba-e752f3bd97bb2899ab67f424eb44d8f3ce0f8b62.tar.xz samba-e752f3bd97bb2899ab67f424eb44d8f3ce0f8b62.zip |
- changed the REQ_REGISTER PDU to be a control
- allow controls to know which client invoked them
- added a client_id to clients, so they can be identified remotely
- added the ability to remove registered srvids
- in the list_keys code, register a temp srvid, then remove it afterwards
(This used to be ctdb commit 29603c51cc6d81362532cd8e50f75c8360c5f5ef)
Diffstat (limited to 'ctdb/common/ctdb_message.c')
-rw-r--r-- | ctdb/common/ctdb_message.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ctdb/common/ctdb_message.c b/ctdb/common/ctdb_message.c index 4d75ac15fc4..1a7a29508f0 100644 --- a/ctdb/common/ctdb_message.c +++ b/ctdb/common/ctdb_message.c @@ -45,7 +45,6 @@ int ctdb_dispatch_message(struct ctdb_context *ctdb, uint64_t srvid, TDB_DATA da return 0; } - /* called when a CTDB_REQ_MESSAGE packet comes in */ @@ -170,3 +169,20 @@ int ctdb_register_message_handler(struct ctdb_context *ctdb, return 0; } + + +/* + setup handler for receipt of ctdb messages from ctdb_send_message() +*/ +int ctdb_deregister_message_handler(struct ctdb_context *ctdb, uint64_t srvid, void *private_data) +{ + struct ctdb_message_list *m; + + for (m=ctdb->message_list;m;m=m->next) { + if (m->srvid == srvid && m->message_private == private_data) { + talloc_free(m); + return 0; + } + } + return -1; +} |