struct list global_list; /* list member for global proxy list */
struct list el; /* attach point in various list
* - <cfg_log_forward> for log forwarder
+ * - <sink_proxies_list> for sink
* - <defaults_list> for defaults section
*/
extern struct list sink_list;
-extern struct proxy *sink_proxies_list;
+extern struct list sink_proxies_list;
struct sink *sink_find(const char *name);
struct sink *sink_find_early(const char *name, const char *from, const char *file, int line);
struct proxy *next;
struct list *list = (struct list *)head;
- if (head == &cfg_log_forward) {
+ if (head == &cfg_log_forward || head == &sink_proxies_list) {
next = cur ?
LIST_ELEM(cur->el.n, struct proxy *, el) :
LIST_ELEM(list->n, struct proxy *, el);
}
if (init_proxies_list == &cfg_log_forward) {
- init_proxies_list = sink_proxies_list;
- /* check if list is not null to avoid infinite loop */
- if (init_proxies_list)
- goto init_proxies_list_stage1;
+ init_proxies_list = &sink_proxies_list;
+ goto init_proxies_list_stage1;
}
/***********************************************************/
}
if (init_proxies_list == &cfg_log_forward) {
- init_proxies_list = sink_proxies_list;
- /* check if list is not null to avoid infinite loop */
- if (init_proxies_list)
- goto init_proxies_list_stage2;
+ init_proxies_list = &sink_proxies_list;
+ goto init_proxies_list_stage2;
}
/*
struct list sink_list = LIST_HEAD_INIT(sink_list);
/* sink proxies list */
-struct proxy *sink_proxies_list;
+struct list sink_proxies_list = LIST_HEAD_INIT(sink_proxies_list);
struct sink *cfg_sink;
px->timeout.connect = TICK_ETERNITY;
px->accept = NULL;
px->options2 |= PR_O2_INDEPSTR | PR_O2_SMARTCON | PR_O2_SMARTACC;
- px->next = sink_proxies_list;
- sink_proxies_list = px;
+ LIST_INSERT(&sink_proxies_list, &px->el);
}
static void _sink_forward_io_handler(struct appctx *appctx,