From: Willy Tarreau Date: Tue, 11 Feb 2025 16:16:14 +0000 (+0100) Subject: MINOR: lbprm: add a new callback ->server_requeue to the lbprm X-Git-Tag: v3.2-dev6~44 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=20b8c4ddba21b9f6e4422595914e35fdf8481188;p=thirdparty%2Fhaproxy.git MINOR: lbprm: add a new callback ->server_requeue to the lbprm 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. --- diff --git a/include/haproxy/backend-t.h b/include/haproxy/backend-t.h index bc21fd16f..f0a469518 100644 --- a/include/haproxy/backend-t.h +++ b/include/haproxy/backend-t.h @@ -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 */ diff --git a/src/lb_fwlc.c b/src/lb_fwlc.c index 011c139d8..b7e81b1a8 100644 --- a/src/lb_fwlc.c +++ b/src/lb_fwlc.c @@ -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) {