]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: servers: Provide a pointer to the server in srv_per_tgroup.
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 17 Apr 2025 09:20:24 +0000 (11:20 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 17 Apr 2025 15:38:23 +0000 (17:38 +0200)
Add a pointer to the server into the struct srv_per_tgroup, so that if
we only have access to that srv_per_tgroup, we can come back to the
corresponding server.

include/haproxy/server-t.h
src/server.c

index dffa2c625583f6adada27fa8c21a5c7ee2ebba55..5253cfc720412d620fd09c3ed5102bbdeb787a27 100644 (file)
@@ -274,6 +274,7 @@ struct srv_per_thread {
 /* Each server will have one occurrence of this structure per thread group */
 struct srv_per_tgroup {
        struct queue queue;                     /* pending connections */
+       struct server *server;                  /* pointer to the corresponding server */
        unsigned int last_other_tgrp_served;    /* Last other tgrp we dequeued from */
        unsigned int self_served;               /* Number of connection we dequeued from our own queue */
        unsigned int dequeuing;                 /* non-zero = dequeuing in progress (atomic) */
index 1e9b2ec84e0b1599fdf1a0de6a041f16de81a9ae..06c4e997977872b03fdf75cbbfbe99a73cfcb6d0 100644 (file)
@@ -5805,8 +5805,10 @@ int srv_init_per_thr(struct server *srv)
                LIST_INIT(&srv->per_thr[i].idle_conn_list);
        }
 
-       for (i = 0; i < global.nbtgroups; i++)
+       for (i = 0; i < global.nbtgroups; i++) {
+               srv->per_tgrp[i].server = srv;
                queue_init(&srv->per_tgrp[i].queue, srv->proxy, srv);
+       }
 
        return 0;
 }