From 05a983dc1489c9b1c8948b8be3faa21c3c35fc3a Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Fri, 26 Jul 2024 14:58:38 -0400 Subject: [PATCH] MT#55283 obsolete bencode_dictionary_add_string_len Change-Id: I22608b09c97bdeee364f67eaa29f291138a2b961 --- daemon/call_interfaces.c | 2 +- daemon/dtmf.c | 6 +++--- include/bencode.h | 7 ------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/daemon/call_interfaces.c b/daemon/call_interfaces.c index b3dd4191e..99b7c4cb2 100644 --- a/daemon/call_interfaces.c +++ b/daemon/call_interfaces.c @@ -2296,7 +2296,7 @@ static const char *call_offer_answer_ng(ng_buffer *ngbuf, bencode_item_t *input, goto out; if (chopper->output->len) - bencode_dictionary_add_string_len(output, "sdp", chopper->output->str, chopper->output->len); + bencode_dictionary_add_str(output, "sdp", &STR_LEN(chopper->output->str, chopper->output->len)); errstr = NULL; out: diff --git a/daemon/dtmf.c b/daemon/dtmf.c index a01b84146..40445ff79 100644 --- a/daemon/dtmf.c +++ b/daemon/dtmf.c @@ -117,10 +117,10 @@ static void dtmf_bencode_and_notify(struct call_media *media, unsigned int event data = bencode_dictionary_add_dictionary(notify, "data"); tags = bencode_dictionary_add_list(data, "tags"); - bencode_dictionary_add_string_len(data, "callid", call->callid.s, call->callid.len); - bencode_dictionary_add_string_len(data, "source_tag", ml->tag.s, ml->tag.len); + bencode_dictionary_add_str(data, "callid", &call->callid); + bencode_dictionary_add_str(data, "source_tag", &ml->tag); if (ml->label.s) { - bencode_dictionary_add_string_len(data, "source_label", ml->label.s, ml->label.len); + bencode_dictionary_add_str(data, "source_label", &ml->label); } tags_ht_iter iter; diff --git a/include/bencode.h b/include/bencode.h index 30f448412..ee15d61ac 100644 --- a/include/bencode.h +++ b/include/bencode.h @@ -115,7 +115,6 @@ bencode_item_t *bencode_dictionary_add_len(bencode_item_t *dict, const char *key * bencode_buffer_t object. */ INLINE bencode_item_t *bencode_dictionary_add_string(bencode_item_t *dict, const char *key, const char *val); INLINE bencode_item_t *bencode_dictionary_add_string_dup(bencode_item_t *dict, const char *key, const char *val); -INLINE bencode_item_t *bencode_dictionary_add_string_len(bencode_item_t *dict, const char *key, const char *val, size_t len); /* Ditto, but for a "str" object */ INLINE bencode_item_t *bencode_dictionary_add_str(bencode_item_t *dict, const char *key, const str *val); @@ -405,12 +404,6 @@ INLINE bencode_item_t *bencode_dictionary_add_string(bencode_item_t *dict, const return bencode_dictionary_add(dict, key, bencode_string(bencode_item_buffer(dict), val)); } -INLINE bencode_item_t *bencode_dictionary_add_string_len(bencode_item_t *dict, const char *key, const char *val, size_t len) { - if (!val) - return NULL; - return bencode_dictionary_add(dict, key, bencode_string_len(bencode_item_buffer(dict), val, len)); -} - INLINE bencode_item_t *bencode_dictionary_add_string_dup(bencode_item_t *dict, const char *key, const char *val) { if (!val) return NULL;