]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: peers: Simplify the peer flags dealing with the connection state
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 24 Apr 2024 13:42:55 +0000 (15:42 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 25 Apr 2024 16:29:57 +0000 (18:29 +0200)
commit229755d8f517f6748e7facdaaf9d2e71ade4f38e
tree2204d7f4871b2a00c3109d3deaa72982e8653627
parentbea541b70aa9e47c051760e6010f34ec202fb722
MEDIUM: peers: Simplify the peer flags dealing with the connection state

Recently, some peer flags were added to deal with the connection state
(PEER_F_ST_*). 3 states were added:

  * RELEASED: Set when we forced to shutdown the peer session and no new
    session was created yet.

  * CONNECTED: Set when the peer has established connection and validated it
    from the peer protocol point of view

  * ACCEPTED: Set when the peer has accepted a connection and validated it
    from the peer protocol point of view

However, management of these pseudo states is a bit confusing. And it
appears there is no reason to have 2 flags to express there is a validated
peer session. CONNECTED state was used for a peer session on the frontend
side while ACCEPTED state was used for a peer session on the backend side.

So, there is now only one "connected" state and we test if the applet was
created on the frontend or the backend side to decide what to do, in
addition to the fact the peer is local or remote.

It is a transitionnal patch. True states will be created to deal with all
this stuff and corresponding flags will be removed.

This patch depends on the commit "MINOR: applet: Add a function to know the
sidde where an applet was created".
src/peers.c