! \brief * Updates PATH of an already appended branch */
| 366 | * Updates PATH of an already appended branch |
| 367 | */ |
| 368 | int 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 |
no outgoing calls
no test coverage detected