]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: stream: lookup server ID using standard functions
authorWilly Tarreau <w@1wt.eu>
Wed, 9 Jul 2025 14:20:09 +0000 (16:20 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 15 Jul 2025 08:30:28 +0000 (10:30 +0200)
commitc8f0b69587649c0f1a6fcb36dc5e0345225deede
tree1a443cf5a3f2e74d41dac5278f7456031eae9fc8
parenta3443db2eb2f7ab33b4b6a3091956b8518099384
CLEANUP: stream: lookup server ID using standard functions

The server lookup in sticking_rule_find_target() uses an open-coded tree
search while we have a function for this server_find_by_id(). In addition,
due to the way it's coded, the stick-table lock also covers the server
lookup by accident instead of being released earlier. This is not a real
problem though since such feature is rarely used nowadays.

Let's clean all this stuff by first retrieving the ID under the lock and
then looking up the corresponding server.
src/stream.c