Skip to content

Commit

Permalink
MAJOR: cli: Use a custom .snd_buf function to only copy the current c…
Browse files Browse the repository at this point in the history
…ommand

The CLI applet is now using its own snd_buf callback function. Instead of
copying as most output data as possible, only one command is copied at a
time.

To do so, a new state CLI_ST_PARSEREQ is added for the CLI applet. In this
state, the CLI I/O handle knows a full command was copied into its input
buffer and it must parse this command to evaluate it.
  • Loading branch information
capflam committed Mar 28, 2024
1 parent 838fb54 commit 87426e8
Show file tree
Hide file tree
Showing 2 changed files with 169 additions and 161 deletions.
1 change: 1 addition & 0 deletions include/haproxy/cli-t.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ enum {
CLI_ST_INIT = 0, /* initial state, must leave to zero ! */
CLI_ST_END, /* final state, let's close */
CLI_ST_GETREQ, /* wait for a request */
CLI_ST_PARSEREQ, /* pase a request */
CLI_ST_OUTPUT, /* all states after this one are responses */
CLI_ST_PROMPT, /* display the prompt (first output, same code) */
CLI_ST_PRINT, /* display const message in cli->msg */
Expand Down
Loading

0 comments on commit 87426e8

Please sign in to comment.