From: Aurelien DARRAGON Date: Tue, 6 Oct 2026 21:08:24 +0000 (+0200) Subject: MINOR: proxy: add e_sub proxy subscrition list X-Git-Tag: v3.5-dev9~40 X-Git-Url: https://git.kaiwu.me/$%7BISSUES%7D/static/gitweb.js?a=commitdiff_plain;h=54cf662634a266bf4ab4e28f093f47b3a39f1495;p=haproxy.git MINOR: proxy: add e_sub proxy subscrition list add e_sub member to proxy struct so that it becomes possible to register to PROXY events for a given proxy. --- diff --git a/include/haproxy/proxy-t.h b/include/haproxy/proxy-t.h index 24b4c72a3..51c0f3ead 100644 --- a/include/haproxy/proxy-t.h +++ b/include/haproxy/proxy-t.h @@ -465,6 +465,8 @@ struct proxy { unsigned int li_ready; /* total number of listeners ready (>=LI_READY) */ unsigned int li_suspended; /* total number of listeners suspended (could be paused or unbound) */ + event_hdl_sub_list e_subs; /* event_hdl: proxy's subscribers list (atomically updated) */ + /* warning: these structs are huge, keep them at the bottom */ struct error_snapshot *invalid_req, *invalid_rep; /* captures of last errors */ diff --git a/src/proxy.c b/src/proxy.c index 9b410cd01..c70fc9cea 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -478,6 +479,8 @@ void deinit_proxy(struct proxy *p) pool_destroy(p->req_cap_pool); pool_destroy(p->rsp_cap_pool); + event_hdl_sub_list_destroy(&p->e_subs); + stktable_deinit(p->table); ha_free(&p->table); ha_free(&p->per_tgrp); @@ -3268,8 +3271,10 @@ int setup_new_proxy(struct proxy *px, const char *name, unsigned int cap, char * if (name && name[0] != '\0' && !(cap & PR_CAP_INT)) proxy_store_name(px); - if (!(cap & PR_CAP_DEF)) + if (!(cap & PR_CAP_DEF)) { LIST_APPEND(&all_proxies, &px->global_list); + event_hdl_sub_list_init(&px->e_subs); + } return 1;