]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: servers: Add a back-pointer to the server in srv_per_thread
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 28 May 2026 13:21:13 +0000 (15:21 +0200)
committerOlivier Houchard <cognet@ci0.org>
Mon, 8 Jun 2026 13:37:50 +0000 (15:37 +0200)
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
src/server.c

index 0d557ab7b9cb95d6dd996d9bc6e870a27d6e2b70..56d2edef7299e9a91c4140f3f26488022bd08f77 100644 (file)
@@ -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
index 2cf2ac34bb4c791c12bf75ab9094da85f0242339..330b0842780ec7e3a561d29e384dc07155269e36 100644 (file)
@@ -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);