From: Willy Tarreau Date: Mon, 27 Oct 2025 14:48:04 +0000 (+0100) Subject: MINOR: cli: create cli_raw_rcv_buf() from the generic applet_raw_rcv_buf() X-Git-Tag: v3.3-dev11~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f38ea2731b1c4aad8cb09d91fd49bc9abb6f9bcc;p=thirdparty%2Fhaproxy.git MINOR: cli: create cli_raw_rcv_buf() from the generic applet_raw_rcv_buf() This is in preparation for a future fix. For now it's simply a pure copy of the original function, but dedicated to the CLI. It will have to be backported to 3.0. --- diff --git a/src/cli.c b/src/cli.c index fcb995a01..059e343d7 100644 --- a/src/cli.c +++ b/src/cli.c @@ -3902,12 +3902,17 @@ error: return -1; } +size_t cli_raw_rcv_buf(struct appctx *appctx, struct buffer *buf, size_t count, unsigned int flags) +{ + return b_xfer(buf, &appctx->outbuf, MIN(count, b_data(&appctx->outbuf))); +} + static struct applet cli_applet = { .obj_type = OBJ_TYPE_APPLET, .flags = APPLET_FL_NEW_API, .name = "", /* used for logging */ .fct = cli_io_handler, - .rcv_buf = appctx_raw_rcv_buf, + .rcv_buf = cli_raw_rcv_buf, .snd_buf = appctx_raw_snd_buf, .release = cli_release_handler, }; @@ -3918,7 +3923,7 @@ static struct applet mcli_applet = { .flags = APPLET_FL_NEW_API, .name = "", /* used for logging */ .fct = cli_io_handler, - .rcv_buf = appctx_raw_rcv_buf, + .rcv_buf = cli_raw_rcv_buf, .snd_buf = appctx_raw_snd_buf, .release = cli_release_handler, };