From d6d736cb5fa80d61e29178f4d0503d70e1a813bc Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 12 Jan 2024 12:58:12 -0500 Subject: [PATCH] MT#55283 unify SDP remove/subst logging Change-Id: I0c1b47f16caae29023b1c870881b791e06480339 --- daemon/sdp.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index 21a18c0d1..9f2931f16 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -331,6 +331,10 @@ static bool sdp_manipulate_remove(struct sdp_manipulations * sdp_manipulations, str_case_ht ht = sdp_manipulations->rem_commands; if (t_hash_table_is_set(ht) && t_hash_table_lookup(ht, attr_name)) return true; + + ilog(LOG_DEBUG, "Cannot insert: '" STR_FORMAT "' because prevented by SDP manipulations (remove)", + STR_FMT(attr_name)); + return false; } @@ -368,6 +372,11 @@ static str *sdp_manipulations_subst(struct sdp_manipulations * sdp_manipulations str_case_value_ht ht = sdp_manipulations->subst_commands; str * cmd_subst_value = t_hash_table_is_set(ht) ? t_hash_table_lookup(ht, attr_name) : NULL; + + if (cmd_subst_value) + ilog(LOG_DEBUG, "Substituting '" STR_FORMAT "' with '" STR_FORMAT "' due to SDP manipulations", + STR_FMT(attr_name), STR_FMT(cmd_subst_value)); + return cmd_subst_value; } @@ -2922,11 +2931,7 @@ static void generic_append_attr_to_gstring(GString *s, const char * name, char s /* first check if the originally present attribute is to be removed */ if (sdp_manipulate_remove(sdp_manipulations, &attr)) - { - ilog(LOG_DEBUG, "Cannot insert: '" STR_FORMAT "' because prevented by SDP manipulations (remove)", - STR_FMT(&attr)); return; - } g_string_append(s, "a="); @@ -2975,11 +2980,7 @@ static void append_attr_int_to_gstring(GString *s, const char * name, const int /* first check if the originally present attribute is to be removed */ if (sdp_manipulate_remove(sdp_manipulations, &attr)) - { - ilog(LOG_DEBUG, "Cannot insert: '" STR_FORMAT "' because prevented by SDP manipulations (remove)", - STR_FMT(&attr)); return; - } /* then, if there remains something to be substituted, do that */ if (attr_subst)