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

Function lb_update_from_replication

modules/load_balancer/load_balancer.c:1075–1101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1073
1074
1075int lb_update_from_replication( unsigned int group, str *uri,
1076 unsigned int flags, int raise_event)
1077{
1078 struct lb_dst *dst;
1079
1080 lock_start_read( ref_lock );
1081
1082 for( dst=(*curr_data)->dsts; dst; dst=dst->next ) {
1083 if ( (dst->group == group) &&
1084 (strncmp(dst->uri.s, uri->s, dst->uri.len) == 0)) {
1085 if ((dst->flags&LB_DST_STAT_MASK) != flags) {
1086 /* import the status flags */
1087 dst->flags = ((~LB_DST_STAT_MASK)&dst->flags)|
1088 (LB_DST_STAT_MASK&flags);
1089 if (raise_event)
1090 /* raise event of status change */
1091 lb_raise_event(dst);
1092 lock_stop_read( ref_lock );
1093 return 0;
1094 }
1095 }
1096 }
1097
1098 lock_stop_read( ref_lock );
1099
1100 return -1;
1101}
1102
1103

Callers 1

lb_recv_status_updateFunction · 0.85

Calls 1

lb_raise_eventFunction · 0.85

Tested by

no test coverage detected