]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: mux-h2: use a safe list_for_each_entry in h2_send()
authorWilly Tarreau <w@1wt.eu>
Fri, 10 Jan 2020 16:01:29 +0000 (17:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Jan 2020 16:18:32 +0000 (17:18 +0100)
commit989539b048bef502a474553a8e330a3d318edb6c
treec608313bcd9075b18d8c1401d8b9ba90266b03e9
parent3c4f40acbf6cd33b874b224a89ee2a64eb3035d5
BUG/MINOR: mux-h2: use a safe list_for_each_entry in h2_send()

h2_send() uses list_for_each_entry() to scan paused streams and resume
them, but happily deletes any leftover from a previous failed unsubscribe,
which is obviously not safe and would corrupt the list. In practice this
is a proof that this doesn't happen, but it's not the best way to prove it.
In order to fix this and reduce the maintenance burden caused by code
duplication (this list walk exists at 3 places), let's introduce a new
function h2_resume_each_sending_h2s() doing exactly this and use it at
all 3 places.

This bug was introduced as a side effect of fix 998410a41b ("BUG/MEDIUM:
h2: Revamp the way send subscriptions works.") so it should be backported
as far as 1.9.
src/mux_h2.c