! \brief * Updates URI of an already appended branch */
| 311 | * Updates URI of an already appended branch |
| 312 | */ |
| 313 | int 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 |
no outgoing calls
no test coverage detected