From 854ab9e2edd285575ac81420685c573dffdf801c Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Thu, 28 Aug 2025 07:42:25 -0400 Subject: [PATCH] MT#55283 lump in subscription log output Avoids redundant loop iteration. Also change log level to INFO to match all other log output. Change-Id: I5587c59398656dc03fcb346edcbc48f350a4a392 (cherry picked from commit d7d7a9807162fc5e7a5d158b01ce46f8962745c8) --- daemon/call.c | 30 +++++++++--------------------- 1 file changed, 9 insertions(+), 21 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index bf991db60..f9d73a81c 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -4108,38 +4108,26 @@ void call_destroy(call_t *c) { STR_FMT_M(&ml->viabranch)); for (__auto_type alias = ml->tag_aliases.head; alias; alias = alias->next) - ilog(LOG_DEBUG, "--- Alias: '" STR_FORMAT "'", STR_FMT(alias->data)); + ilog(LOG_INFO, "--- Alias: '" STR_FORMAT "'", STR_FMT(alias->data)); - for (unsigned int i = 0; i < ml->medias->len; i++) - { - struct call_media *media = ml->medias->pdata[i]; - if (!media) + for (unsigned int m = 0; m < ml->medias->len; m++) { + md = ml->medias->pdata[m]; + if (!md) continue; - for (__auto_type ll = media->media_subscriptions.head; ll; ll = ll->next) + + for (__auto_type ll = md->media_subscriptions.head; ll; ll = ll->next) { struct media_subscription * ms = ll->data; - ilog(LOG_DEBUG, "--- subscribed to media with monologue tag '" STR_FORMAT_M "' (index: %d)", + ilog(LOG_INFO, "--- subscribed to media with monologue tag '" STR_FORMAT_M "' (index: %d)", STR_FMT_M(&ms->monologue->tag), ms->media->index); } - } - for (unsigned int i = 0; i < ml->medias->len; i++) - { - struct call_media *media = ml->medias->pdata[i]; - if (!media) - continue; - for (__auto_type ll = media->media_subscribers.head; ll; ll = ll->next) + for (__auto_type ll = md->media_subscribers.head; ll; ll = ll->next) { struct media_subscription * ms = ll->data; - ilog(LOG_DEBUG, "--- subscription for media with monologue tag '" STR_FORMAT_M "' (index: %d)", + ilog(LOG_INFO, "--- subscription for media with monologue tag '" STR_FORMAT_M "' (index: %d)", STR_FMT_M(&ms->monologue->tag), ms->media->index); } - } - - for (unsigned int m = 0; m < ml->medias->len; m++) { - md = ml->medias->pdata[m]; - if (!md) - continue; // stats output only - no cleanups