]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: master/cli: only parse the '@@' prefix on complete lines
authorWilly Tarreau <w@1wt.eu>
Fri, 25 Apr 2025 06:40:57 +0000 (08:40 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 25 Apr 2025 07:05:00 +0000 (09:05 +0200)
commit7a79f54c98d8fa5d69a02ea443644a4de299aba2
tree58b86041325a0625ad28b0b6408226d1d4ee1180
parent931d932b3e8b762f69a9b779e858fe29a0712298
BUG/MINOR: master/cli: only parse the '@@' prefix on complete lines

The new adhoc parser for the '@@' prefix forgot to require the presence
of the LF character marking the end of the line. This is the reason why
entering incomplete commands would display garbage, because the line was
expected to have its LF character replaced with a zero.

The problem is well illustrated by using socat in raw mode:

   socat /tmp/master.sock STDIO,raw,echo=0

then entering "@@1 show info" one character at a time would error just
after the second "@". The command must take care to report an incomplete
line and wait for more data in such a case.
src/cli.c