From: Christopher Faulet Date: Fri, 22 Mar 2024 15:23:40 +0000 (+0100) Subject: MINOR: peers: Add functions to commit peer changes from the resync task X-Git-Tag: v3.0-dev8~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=bdf16348837f42a15e7489900cb6d019a55615fb;p=thirdparty%2Fhaproxy.git MINOR: peers: Add functions to commit peer changes from the resync task For now, nothing is done in these functions. It is only a patch to prepare the huge part of the refactoring about the locking mechanism of the peers. These functions will be responsible to check peers state and their learn status to update the peers section flags accordingly. --- diff --git a/src/peers.c b/src/peers.c index 8d4377f696..01e98f4d0f 100644 --- a/src/peers.c +++ b/src/peers.c @@ -3411,6 +3411,14 @@ static struct appctx *peer_session_create(struct peers *peers, struct peer *peer return NULL; } +static void __process_peer_learn_status(struct peers *peers, struct peer *peer) +{ +} + +static void __process_peer_state(struct peers *peers, struct peer *peer) +{ +} + static void __process_running_peer_sync(struct task *task, struct peers *peers, unsigned int state) { struct peer *ps; @@ -3447,6 +3455,9 @@ static void __process_running_peer_sync(struct task *task, struct peers *peers, /* For each session */ for (ps = peers->remote; ps; ps = ps->next) { + __process_peer_learn_status(peers, ps); + __process_peer_state(peers, ps); + /* For each remote peers */ if (!ps->local) { if (!ps->appctx) { @@ -3585,6 +3596,9 @@ static void __process_stopping_peer_sync(struct task *task, struct peers *peers, /* For each peer */ for (ps = peers->remote; ps; ps = ps->next) { + __process_peer_learn_status(peers, ps); + __process_peer_state(peers, ps); + if ((state & TASK_WOKEN_SIGNAL) && !(peers->flags & PEERS_F_DONOTSTOP)) { /* we're killing a connection, we must apply a random delay before * retrying otherwise the other end will do the same and we can loop