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

Function w_lb_next

modules/load_balancer/load_balancer.c:518–543  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

516
517
518static int w_lb_next(struct sip_msg *req, pv_spec_t *attrs_var)
519{
520 int ret;
521 str attrs_str = {0,0};
522 pv_value_t pv_val;
523
524 lock_start_read(ref_lock);
525
526 /* do lb */
527 ret = do_lb_next(req, *curr_data, attrs_var ? &attrs_str : NULL);
528
529 lock_stop_read(ref_lock);
530
531 if (attrs_var) {
532 pv_val.flags = PV_VAL_STR;
533 pv_val.rs = (attrs_str.s && attrs_str.len) ? attrs_str : attrs_empty;
534 if (pv_set_value(req, attrs_var, 0, &pv_val) != 0) {
535 LM_ERR("failed to set output variable\n");
536 return -1;
537 }
538 }
539
540 if( ret < 0 )
541 return ret;
542 return 1;
543}
544
545
546static int w_lb_start(struct sip_msg *req, int *grp_no,

Callers 1

w_lb_start_or_nextFunction · 0.85

Calls 2

do_lb_nextFunction · 0.85
pv_set_valueFunction · 0.85

Tested by

no test coverage detected