]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: session: document explicitely that session_add_conn() is safe
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 13 Aug 2025 16:13:10 +0000 (18:13 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 28 Aug 2025 12:52:29 +0000 (14:52 +0200)
commitd0df41fd22ac61365d06a8fa046dbfdb0b5b4328
tree1814ecd14f6b98ebfb930491ac01f96af4e43de9
parentb3ce4644354326616eddc3b701aaba5c7ded36d7
MINOR: session: document explicitely that session_add_conn() is safe

A set of recent patches have simplified management of backend connection
attached to sessions. The API is now stricter to prevent any misuse.

One of this change is the addition of a BUG_ON() in session_add_conn(),
which ensures that a connection is not attached to a session if its
<owner> field points to another entry.

On older haproxy releases, this assertion could not be enforced due to
NTLM as a connection is turned as private during its transfer. When
using a true multiplexed protocol on the backend side, the connection
could be assigned in turn to several sessions. However, NTLM is now only
applied for HTTP/1.1 as it does not make sense if the connection is
already shared.

To better clarify this situation, extend the comment on BUG_ON() inside
session_add_conn().
include/haproxy/session.h