mirror of
https://github.com/haproxy/haproxy.git
synced 2026-05-28 04:12:17 -04:00
MINOR: servers: Provide a pointer to the server in srv_per_tgroup.
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.
This commit is contained in:
parent
5e1ce09e54
commit
444125a764
2 changed files with 4 additions and 1 deletions
|
|
@ -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) */
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue