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

Function load_lb_data

modules/load_balancer/lb_data.c:49–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

47
48
49struct lb_data* load_lb_data(void)
50{
51 struct lb_data *data;
52
53 data = (struct lb_data*) shm_malloc( sizeof(struct lb_data) );
54 if (data==NULL) {
55 LM_ERR("failed to allocate shm mem\n");
56 return NULL;
57 }
58 memset( data, 0, sizeof(struct lb_data));
59
60 if (lb_db_load_data(data)!=0) {
61 LM_ERR("failed to load data from DB\n");
62 free_lb_data(data);
63 return NULL;
64 }
65
66 return data;
67}
68
69
70struct lb_resource *get_resource_by_name(struct lb_data *data, str *name)

Callers 1

lb_reload_dataFunction · 0.85

Calls 3

shm_mallocFunction · 0.85
lb_db_load_dataFunction · 0.85
free_lb_dataFunction · 0.85

Tested by

no test coverage detected