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

Function __bencode_str_dump

modules/rtpengine/bencode.c:359–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359static int __bencode_str_dump(char *out, bencode_item_t *item) {
360 char *orig = out;
361 bencode_item_t *child;
362
363 assert(item->iov[0].iov_base != NULL);
364 out += __bencode_str_cpy(out, &item->iov[0], 1);
365
366 child = item->child;
367 while (child) {
368 out += __bencode_str_dump(out, child);
369 child = child->sibling;
370 }
371
372 if (item->type == BENCODE_IOVEC)
373 out += __bencode_str_cpy(out, item->iov[1].iov_base, item->iov[1].iov_len);
374 else if (item->iov[1].iov_base)
375 out += __bencode_str_cpy(out, &item->iov[1], 1);
376
377 assert((out - orig) == item->str_len);
378 *out = '\0';
379 return item->str_len;
380}
381
382struct iovec *bencode_iovec(bencode_item_t *root, int *cnt, unsigned int head, unsigned int tail) {
383 struct iovec *ret;

Callers 2

bencode_collapseFunction · 0.85
bencode_collapse_dupFunction · 0.85

Calls 1

__bencode_str_cpyFunction · 0.85

Tested by

no test coverage detected