update_freq_ctr(&th_ctx->out_32bps, (bytes + 16) / 32);
}
-/* Insert <px> at the front of the global list of visible proxies. This should
- * only be used during configuration parsing. At runtime, a newly added proxy
- * should be appended at the end of the list instead.
- */
+/* Append <px> at the end of the global list of visible proxies. */
static inline void main_proxies_register(struct proxy *px)
{
- LIST_INSERT(&main_proxies, &px->el);
+ LIST_APPEND(&main_proxies, &px->el);
}
/* Returns first entry in main proxies list or NULL if empty. */
*/
int check_config_validity()
{
- struct list tmp_list = LIST_HEAD_INIT(tmp_list);
int cfgerr = 0, ret;
- struct proxy *defpx, *old;
+ struct proxy *defpx;
void *init_proxies_list = NULL;
struct stktable *t;
struct server *newsrv = NULL;
if (err_code != ERR_NONE)
goto out;
- /* first, we will invert the proxy list order */
- list_for_each_entry_safe(curproxy, old, &main_proxies, el) {
- LIST_DELETE(&curproxy->el);
- LIST_INSERT(&tmp_list, &curproxy->el);
- }
- LIST_SPLICE(&main_proxies, &tmp_list);
-
/*
* we must finish to initialize certain things on the servers,
* as some of the fields may be accessed soon
proxy_index_id(px);
dynpx_next_id = px->uuid;
- LIST_APPEND(&main_proxies, &px->el);
-
+ /* Insert <px> into <main_proxies> list of visible proxies. Note that
+ * insertion in <proxies> has already been performed in
+ * setup_new_proxy() via alloc_new_proxy().
+ */
+ main_proxies_register(px);
thread_release();
if (unlikely(!be_supports_dynamic_srv(px, &msg)))