mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 15:17:01 +02:00
MINOR: lbprm: Add method to deinit server and proxy
Add two new methods to lbprm, server_deinit() and proxy_deinit(), in case something should be done at the lbprm level when removing servers and proxies.
This commit is contained in:
parent
17059098e7
commit
2a9436f96b
@ -181,6 +181,8 @@ struct lbprm {
|
||||
void (*server_take_conn)(struct server *); /* to be called when connection is assigned */
|
||||
void (*server_drop_conn)(struct server *); /* to be called when connection is dropped */
|
||||
void (*server_requeue)(struct server *); /* function used to place the server where it must be */
|
||||
void (*proxy_deinit)(struct proxy *); /* to be called when we're destroying the proxy */
|
||||
void (*server_deinit)(struct server *); /* to be called when we're destroying the server */
|
||||
};
|
||||
|
||||
#endif /* _HAPROXY_BACKEND_T_H */
|
||||
|
@ -372,6 +372,9 @@ void free_proxy(struct proxy *p)
|
||||
*/
|
||||
srv_free_params(&p->defsrv);
|
||||
|
||||
if (p->lbprm.proxy_deinit)
|
||||
p->lbprm.proxy_deinit(p);
|
||||
|
||||
list_for_each_entry_safe(l, l_next, &p->conf.listeners, by_fe) {
|
||||
guid_remove(&l->guid);
|
||||
LIST_DELETE(&l->by_fe);
|
||||
|
@ -3114,6 +3114,9 @@ struct server *srv_drop(struct server *srv)
|
||||
|
||||
EXTRA_COUNTERS_FREE(srv->extra_counters);
|
||||
|
||||
if (srv->proxy->lbprm.server_deinit)
|
||||
srv->proxy->lbprm.server_deinit(srv);
|
||||
|
||||
ha_free(&srv);
|
||||
|
||||
end:
|
||||
|
Loading…
Reference in New Issue
Block a user