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

Function update_msg_branch_path

dset.c:368–391  ·  view source on GitHub ↗

! \brief * Updates PATH of an already appended branch */

Source from the content-addressed store, hash-verified

366 * Updates PATH of an already appended branch
367 */
368int update_msg_branch_path(unsigned int idx, str *val)
369{
370 struct dset_ctx *dsct = get_dset_ctx();
371 struct msg_branch_wrap *br;
372
373 if (!dsct || !dsct->enabled || idx >= dsct->nr_branches)
374 return -1;
375
376 br = dsct->branches + idx;
377
378 if (ZSTRP(val)) {
379 br->branch.path.s = NULL;
380 br->branch.path.len = 0;
381 } else {
382 if (val->len > MAX_PATH_SIZE - 1) {
383 LM_ERR("too long path: [%.*s]/%d\n", val->len, val->s,val->len);
384 return -1;
385 }
386 br->branch.path.s = br->path; /* internal buffer */
387 br->branch.path.len = val->len;
388 memcpy( br->branch.path.s, val->s, val->len);
389 }
390 return 0;
391}
392
393
394/* ! \brief

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected