MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / __bencode_container_add

Function __bencode_container_add

modules/rtpengine/bencode.c:200–221  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200static void __bencode_container_add(bencode_item_t *parent, bencode_item_t *child) {
201 if (!parent)
202 return;
203 if (!child)
204 return;
205
206 assert(child->parent == NULL);
207 assert(child->sibling == NULL);
208
209 child->parent = parent;
210 if (parent->last_child)
211 parent->last_child->sibling = child;
212 parent->last_child = child;
213 if (!parent->child)
214 parent->child = child;
215
216 while (parent) {
217 parent->iov_cnt += child->iov_cnt;
218 parent->str_len += child->str_len;
219 parent = parent->parent;
220 }
221}
222
223static bencode_item_t *__bencode_string_alloc(bencode_buffer_t *buf, const void *base,
224 int str_len, int iov_len, int iov_cnt, bencode_type_t type)

Callers 4

bencode_list_addFunction · 0.85
__bencode_decode_listFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected