mirror of
https://github.com/haproxy/haproxy.git
synced 2026-04-20 22:01:49 -04:00
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.
This commit is contained in:
parent
35106d65fb
commit
f38ea2731b
1 changed files with 7 additions and 2 deletions
|
|
@ -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 = "<CLI>", /* 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 = "<MCLI>", /* 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,
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue