diff options
author | Volker Lendecke <vl@samba.org> | 2020-02-11 21:47:39 +0100 |
---|---|---|
committer | Björn Baumbach <bb@sernet.de> | 2020-02-18 11:38:40 +0000 |
commit | dab982d88e9132cbff52db22f441c08ee59bb159 (patch) | |
tree | 3b67c309fe79037af26318a9e58940181665dbe4 | |
parent | 8a23031b7bfea4cdaa71d6815bca24dcc3685b22 (diff) | |
download | samba-dab982d88e9132cbff52db22f441c08ee59bb159.tar.gz |
lib: Add a TALLOC_CTX to base register_msg_pool_usage() on
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>
-rw-r--r-- | source3/include/proto.h | 3 | ||||
-rw-r--r-- | source3/lib/messages.c | 2 | ||||
-rw-r--r-- | source3/lib/tallocmsg.c | 5 |
3 files changed, 6 insertions, 4 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h index e03486f07ab..6ac70a22beb 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -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 */ diff --git a/source3/lib/messages.c b/source3/lib/messages.c index a6bf99578b6..065ccd3a262 100644 --- a/source3/lib/messages.c +++ b/source3/lib/messages.c @@ -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); diff --git a/source3/lib/tallocmsg.c b/source3/lib/tallocmsg.c index 9cef2a8e10b..bc0fa132e32 100644 --- a/source3/lib/tallocmsg.c +++ b/source3/lib/tallocmsg.c @@ -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, |