]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: session: refactor alloc/lookup of sess_conns elements
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 21 Aug 2025 13:59:33 +0000 (15:59 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Aug 2025 12:52:29 +0000 (14:52 +0200)
commitf3e8e863c909047d077d12a7e65573834ea3e7ae
tree067f5f4c41c0c89f2570d3c31361e424b8ef39f5
parentd4f7a2dbcc5f6a06bce4b36c9af60abe833d73d9
MINOR: session: refactor alloc/lookup of sess_conns elements

By default backend connections are stored into idle/avail server trees.
However, if such connections cannot be shared between multiple clients,
session serves as the alternative storage.

To be able to quickly reuse a backend conn from a session, they are
indexed by their target, which is either a server or a backend proxy.
This is the purpose of 'struct sess_priv_conns' intermediary stockage
element.

Lookup and allocation of these elements are performed in several session
function, for example to add, get or remove a backend connection from a
session. The purpose of this patch is to simplify this by providing two
internal functions sess_alloc_sess_conns() and sess_get_sess_conns().

Along with this, a new BUG_ON() is added into session_unown_conn(),
which ensure that sess_priv_conns element is found when the connection
is removed from the session.
src/session.c