]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: lbprm: add a new callback ->server_requeue to the lbprm
authorWilly Tarreau <w@1wt.eu>
Tue, 11 Feb 2025 16:16:14 +0000 (17:16 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 11 Feb 2025 16:16:14 +0000 (17:16 +0100)
This callback will be used to reposition a server to its expected
position regardless of the fact that it was taken or dropped. It
will only be used by supporting LB algos. For now, only fwlc defines
it and assigns it to fwlc_srv_reposition(). At the moment it's not
used yet.

include/haproxy/backend-t.h
src/lb_fwlc.c

index bc21fd16f55c2d75ba030b6686fbcc37d50b74f5..f0a46951832bfa4f09576dfebb7efae6cc2e0369 100644 (file)
@@ -180,6 +180,7 @@ struct lbprm {
        void (*set_server_status_down)(struct server *); /* to be called after status changes to DOWN // srvlock */
        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 */
 };
 
 #endif /* _HAPROXY_BACKEND_T_H */
index 011c139d825acfd79bdc12b376ce60a2e9d3ebcb..b7e81b1a8ed0c17ed7bad57bfbe75534f7b4cba2 100644 (file)
@@ -292,6 +292,7 @@ void fwlc_init_server_tree(struct proxy *p)
        p->lbprm.update_server_eweight  = fwlc_update_server_weight;
        p->lbprm.server_take_conn = fwlc_srv_reposition;
        p->lbprm.server_drop_conn = fwlc_srv_reposition;
+       p->lbprm.server_requeue   = fwlc_srv_reposition;
 
        p->lbprm.wdiv = BE_WEIGHT_SCALE;
        for (srv = p->srv; srv; srv = srv->next) {