*srv_ptr = NULL;
}
+/* index server <srv>'s id into proxy <px>'s used_server_id */
+static inline void server_index_id(struct proxy *px, struct server *srv)
+{
+ eb32_insert(&px->conf.used_server_id, &srv->conf.id);
+}
+
/* increase the number of cumulated streams on the designated server */
static inline void srv_inc_sess_ctr(struct server *s)
{
*/
next_id = server_get_next_id(curproxy, next_id);
newsrv->conf.id.key = newsrv->puid = next_id;
- eb32_insert(&curproxy->conf.used_server_id, &newsrv->conf.id);
+ server_index_id(curproxy, newsrv);
}
next_id++;
* check_config_validity.
*/
if (newsrv->flags & SRV_F_FORCED_ID)
- eb32_insert(&curproxy->conf.used_server_id, &newsrv->conf.id);
+ server_index_id(curproxy, newsrv);
HA_DIAG_WARNING_COND((curproxy->cap & PR_CAP_LB) && !newsrv->uweight,
"configured with weight of 0 will never be selected by load balancing algorithms\n");
}
/* insert the server in the backend trees */
- eb32_insert(&be->conf.used_server_id, &srv->conf.id);
+ server_index_id(be, srv);
cebis_item_insert(&be->conf.used_server_name, conf.name_node, id, srv);
/* addr_key could be NULL if FQDN resolution is postponed (ie: add server from cli) */
if (srv->addr_key)