]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: mcli: always realign wrapping buffers before parsing them
authorWilly Tarreau <w@1wt.eu>
Thu, 20 Jan 2022 07:47:35 +0000 (08:47 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 20 Jan 2022 17:56:57 +0000 (18:56 +0100)
commita4e4d66f701b58da87cad0a2a90dea7e7553bc71
treec577bf2871fb72d4e092149f59881a74c70fa6f4
parent6cd93f52e974aca4dac7aa2756c4e17659ae5354
BUG/MEDIUM: mcli: always realign wrapping buffers before parsing them

Pipelined commands easily result in request buffers to wrap, and the
master-cli parser only deals with linear buffers since it needs contiguous
keywords to look for in a list. As soon as a buffer wraps, some commands
are ignored and the parser is called in loops because the wrapped data
do not leave the buffer.

Let's take the easiest path that's already used at the HTTP layer, we
simply realign the buffer if its input wraps. This rarely happens anyway
(typically once per buffer), remains reasonably cheap and guarantees this
cannot happen anymore.

This needs to be backported as far as 2.0.
src/cli.c