diff options
author | Ralph Wuerthner <ralph.wuerthner@de.ibm.com> | 2019-03-29 12:30:45 +0100 |
---|---|---|
committer | Christof Schmitt <cs@samba.org> | 2019-04-04 22:39:31 +0000 |
commit | b4d4778dd2c5831204fb484a6c6872ab3cbebf01 (patch) | |
tree | 1b6d3d1198ac882cb60509c602acdce8e55178b7 /source3/lib | |
parent | 00874b614449b094300a4e249ead22618031b1d8 (diff) | |
download | samba-b4d4778dd2c5831204fb484a6c6872ab3cbebf01.tar.gz |
s3-messages: modify msg_pool_usage() to allow enhanced memory reports
Signed-off-by: Ralph Wuerthner <ralph.wuerthner@de.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/tallocmsg.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/source3/lib/tallocmsg.c b/source3/lib/tallocmsg.c index 18b16edfc8f..b5ab21c5661 100644 --- a/source3/lib/tallocmsg.c +++ b/source3/lib/tallocmsg.c @@ -30,21 +30,32 @@ static void msg_pool_usage(struct messaging_context *msg_ctx, struct server_id src, DATA_BLOB *data) { - char *report; + char *report = NULL; + int iov_size = 0; + struct iovec iov[1]; SMB_ASSERT(msg_type == MSG_REQ_POOL_USAGE); DEBUG(2,("Got POOL_USAGE\n")); report = talloc_report_str(msg_ctx, NULL); - if (report != NULL) { - messaging_send_buf(msg_ctx, src, MSG_POOL_USAGE, - (uint8_t *)report, - talloc_get_size(report)-1); + iov[iov_size].iov_base = report; + iov[iov_size].iov_len = talloc_get_size(report) - 1; + iov_size++; + } + + if (iov_size) { + messaging_send_iov(msg_ctx, + src, + MSG_POOL_USAGE, + iov, + iov_size, + NULL, + 0); } - talloc_free(report); + TALLOC_FREE(report); } /** |