From 6f8dab258379dd53e327433ffd890c6d3d6f89ed Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Thu, 28 May 2026 15:21:13 +0200 Subject: [PATCH] MINOR: servers: Add a back-pointer to the server in srv_per_thread In struct srv_per_thread, add a pointer to the server, as with just a pointer to srv_per_thread, we can't figure out the related server. --- include/haproxy/server-t.h | 1 + src/server.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/haproxy/server-t.h b/include/haproxy/server-t.h index 0d557ab7b..56d2edef7 100644 --- a/include/haproxy/server-t.h +++ b/include/haproxy/server-t.h @@ -279,6 +279,7 @@ struct srv_per_thread { struct ceb_root *idle_conns; /* Shareable idle connections */ struct ceb_root *safe_conns; /* Safe idle connections */ struct ceb_root *avail_conns; /* Connections in use, but with still new streams available */ + struct server *srv; /* Back-pointer to the server */ #ifdef USE_QUIC struct ist quic_retry_token; #endif diff --git a/src/server.c b/src/server.c index 2cf2ac34b..330b08427 100644 --- a/src/server.c +++ b/src/server.c @@ -6128,6 +6128,7 @@ static int srv_init_per_thr(struct server *srv) srv->per_thr[i].idle_conns = NULL; srv->per_thr[i].safe_conns = NULL; srv->per_thr[i].avail_conns = NULL; + srv->per_thr[i].srv = srv; MT_LIST_INIT(&srv->per_thr[i].sess_conns); MT_LIST_INIT(&srv->per_thr[i].streams);