]> git.ipfire.org Git - thirdparty/haproxy.git/commit
DEBUG: channel: add consistency checks using BUG_ON_HOT() in some key functions
authorWilly Tarreau <w@1wt.eu>
Mon, 28 Feb 2022 15:55:51 +0000 (16:55 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 28 Feb 2022 15:59:17 +0000 (16:59 +0100)
commit68ae291cd20f91581b85dca1a13a58c0db492196
tree3d9119278b8390ba22b09d4d580b68e90244540e
parent84240044f0ecebac489f5b689142a9dfe27ea99d
DEBUG: channel: add consistency checks using BUG_ON_HOT() in some key functions

A few functions such as c_adv(), c_rew(), co_set_data() or co_skip() got a
BUG_ON_HOT() to make sure they're not used to push more data than available
in the buffer. Note that with HTX the margin can be high and will less easily
trigger, but the goal is to detect a misuse early enough.

co_data() should never be called with a wrong c->output. At least it never
happens in regtests, but we're adding a CHECK_IF_HOT() there to avoid crashing
but report it if it ever happened when the hot path checks are enabled.
include/haproxy/channel.h