BUG/MEDIUM: cli: Don't consume data if outbuf is full or not available
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 16 Jun 2025 13:48:04 +0000 (15:48 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 17 Jun 2025 06:04:39 +0000 (08:04 +0200)
commit24953fff90f9d04b684859e8134cba3c43653ea1
treedd55eeae457c14d205bee69537a2a7b9d5ebb4c4
parentc7402ad2121d74e2805a81989b9cbc39b5baf692
BUG/MEDIUM: cli: Don't consume data if outbuf is full or not available

The output buffer must be available to process a command, at least to be
able to emit error messages. When this buffer is full or cannot be
allocated, we must wait. In that case, we must take care to notify the SE
will not consume input data. It is important to avoid wakeup in loop,
especially when the client aborts.

When the output buffer is available again and no longer full, and the CLI
applet is waiting for a command line, it must notify it will consume input
data.

This patch must be backported as far as 3.0.

(cherry picked from commit 396f0252bf3a400c9dbfdaf730e994bb44f198dd)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit de668f5eb86f0370357042badc07a90e5d565576)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 6072496521b2feb0ffcae5b72b95adff10291b7b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/cli.c