lib: Add a TALLOC_CTX to base register_msg_pool_usage() on
authorVolker Lendecke <vl@samba.org>
Tue, 11 Feb 2020 20:47:39 +0000 (21:47 +0100)
committerBjörn Baumbach <bb@sernet.de>
Tue, 18 Feb 2020 11:38:40 +0000 (11:38 +0000)
Add a simple way to deactivate the registration

Bug: https://bugzilla.samba.org/show_bug.cgi?id=14281

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/include/proto.h
source3/lib/messages.c
source3/lib/tallocmsg.c

index e03486f07ab8ae512e16e9deccaef22cfe75ad41..6ac70a22beb73f1265d92c020fc2b0d35323ba33 100644 (file)
@@ -266,7 +266,8 @@ bool getgroups_unix_user(TALLOC_CTX *mem_ctx, const char *user,
 
 /* The following definitions come from lib/tallocmsg.c  */
 
-void register_msg_pool_usage(struct messaging_context *msg_ctx);
+void register_msg_pool_usage(TALLOC_CTX *mem_ctx,
+                            struct messaging_context *msg_ctx);
 
 /* The following definitions come from lib/time.c  */
 
index a6bf99578b6f35a739b52935b5f44e1eb1ccbf40..065ccd3a2620934ff5ffd787fb72195eb0defaf2 100644 (file)
@@ -590,7 +590,7 @@ static NTSTATUS messaging_init_internal(TALLOC_CTX *mem_ctx,
 
        /* Register some debugging related messages */
 
-       register_msg_pool_usage(ctx);
+       register_msg_pool_usage(ctx, ctx);
        register_dmalloc_msgs(ctx);
        debug_register_msgs(ctx);
 
index 9cef2a8e10b0730658d31f2da64fe4bc831684ac..bc0fa132e327d82226d2ab417c9c9945107e5eb8 100644 (file)
@@ -69,12 +69,13 @@ static bool pool_usage_filter(struct messaging_rec *rec, void *private_data)
 /**
  * Register handler for MSG_REQ_POOL_USAGE
  **/
-void register_msg_pool_usage(struct messaging_context *msg_ctx)
+void register_msg_pool_usage(
+       TALLOC_CTX *mem_ctx, struct messaging_context *msg_ctx)
 {
        struct tevent_req *req = NULL;
 
        req = messaging_filtered_read_send(
-               msg_ctx,
+               mem_ctx,
                messaging_tevent_context(msg_ctx),
                msg_ctx,
                pool_usage_filter,