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

Function update_msg_branch_uri

dset.c:313–332  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

311 * Updates URI of an already appended branch
312 */
313int update_msg_branch_uri(unsigned int idx, str *val)
314{
315 struct dset_ctx *dsct = get_dset_ctx();
316 struct msg_branch_wrap *br;
317
318 if (!dsct || !dsct->enabled || idx >= dsct->nr_branches || ZSTRP(val))
319 return -1;
320
321 br = dsct->branches + idx;
322
323 if (val->len > MAX_URI_SIZE - 1) {
324 LM_ERR("too long uri: [%.*s]/%d\n", val->len, val->s, val->len);
325 return -1;
326 }
327 br->branch.uri.s = br->uri; /* internal buffer */
328 br->branch.uri.len = val->len;
329 memcpy( br->branch.uri.s, val->s, val->len);
330
331 return 0;
332}
333
334
335/* ! \brief

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected