]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: session: streamline session_check_idle_conn() usage
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 30 Jul 2025 09:56:05 +0000 (11:56 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 30 Jul 2025 14:13:30 +0000 (16:13 +0200)
commit2ecc5290f2204e9a1f020caaa18f0608c1191912
tree9e7761c941208d540bb78d8c82d8b679238f9b63
parentdd9645d6b9fd48e81bb25ec6f64f86fabcbd8924
MINOR: session: streamline session_check_idle_conn() usage

session_check_idle_conn() is called by muxes when a connection becomes
idle. It ensures that the session idle limit is not yet reached. Else,
the connection is removed from the session and it can be freed.

Prior to this patch, session_check_idle_conn() was compatible with a
NULL session argument. In this case, it would return true, considering
that no limit was reached and connection not removed.

However, this renders the function error-prone and subject to future
bugs. This patch streamlines it by ensuring it is never called with a
NULL argument. Thus it can now only returns true if connection is kept
in the session or false if it was removed, as first intended.
include/haproxy/session.h