]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: rhttp: fix preconnect on single-thread
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 21 May 2024 14:35:28 +0000 (16:35 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 22 May 2024 08:01:57 +0000 (10:01 +0200)
commitceebb09744df367ad84586a341d9336f84f72bce
tree7b4a8a6086099e110f9513a675431cafe3a14c4d
parent4f80543220910d81ca606835b5193e5638d2b950
BUG/MEDIUM: rhttp: fix preconnect on single-thread

On initialization of a rhttp bind, the first thread available on the
listener is selected to execute the first occurence of the preconnect
task.

This thread selection was incorrect as it used my_ffsl() which returns
value indexed from 1, contrary to tid which are indexed from 0. This
cause the first listener thread to be skipped in favor of the second
one. Worst, if haproxy runs in single-thread mode, calculated thread ID
will be invalid and the task will never run, which prevent any
preconnect execution.

Fix this by substracting the result of my_ffsl() by 1 to have a value
indexed from 0.

This must be backported up to 2.9.
src/proto_rhttp.c