s4-messaging: Add helpful comments
authorAndrew Bartlett <abartlet@samba.org>
Tue, 28 Mar 2017 08:55:47 +0000 (21:55 +1300)
committerStefan Metzmacher <metze@samba.org>
Wed, 26 Apr 2017 01:09:19 +0000 (03:09 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Apr 26 03:09:19 CEST 2017 on sn-devel-144

source4/lib/messaging/messaging.c

index 2da0acc0c7ab021f00e3dc9212103c3992defd4b..b8d4e50f12c758dd6945dd8b7c78331fc14c8dd8 100644 (file)
@@ -391,6 +391,10 @@ struct imessaging_context *imessaging_init(TALLOC_CTX *mem_ctx,
 
        tdb_flags |= lpcfg_tdb_flags(lp_ctx, 0);
 
+       /*
+        * This context holds a destructor that cleans up any names
+        * registered on this context on talloc_free()
+        */
        msg->names = server_id_db_init(msg, server_id, lock_dir, 0, tdb_flags);
        if (msg->names == NULL) {
                goto fail;
@@ -767,6 +771,9 @@ static int irpc_destructor(struct irpc_request *irpc)
 
 /*
   add a string name that this irpc server can be called on
+
+  It will be removed from the DB either via irpc_remove_name or on
+  talloc_free(msg_ctx->names).
 */
 NTSTATUS irpc_add_name(struct imessaging_context *msg_ctx, const char *name)
 {