]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: cli: Don't set SE flags from the cli applet
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2025 14:15:27 +0000 (15:15 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 6 Feb 2025 14:23:20 +0000 (15:23 +0100)
Since the CLI was updated to use the new applet API, it should no longer set
directly the SE flags. Instead, the corresponding applet flags must be set,
using the applet API (appet_set_*). It is true for the CLI I/O handler but also
for the commands parse function and I/O callback function.

This patch should be backported as far as 3.0.

src/cli.c

index 84aa46fbee31322a25db66fcc4ed5ce63dd0c0d1..cde0cab2babd1befc519489935c3a3802fe73b9c 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1181,7 +1181,7 @@ static void cli_io_handler(struct appctx *appctx)
                                        }
                                break;
                        default: /* abnormal state */
-                               se_fl_set(appctx->sedesc, SE_FL_ERROR);
+                               applet_set_error(appctx);
                                break;
                        }
 
@@ -2442,7 +2442,7 @@ out:
                ha_warning("Cannot make the unix socket non-blocking\n");
                goto out;
        }
-       se_fl_set(appctx->sedesc, SE_FL_EOI);
+       applet_set_eoi(appctx);
        appctx->st0 = CLI_ST_END;
        free(cmsgbuf);
        free(tmpbuf);
@@ -2464,7 +2464,7 @@ static int cli_parse_simple(char **args, char *payload, struct appctx *appctx, v
                        appctx->st1 ^= APPCTX_CLI_ST1_PROMPT;
        else if (*args[0] == 'q') {
                /* quit */
-               se_fl_set(appctx->sedesc, SE_FL_EOI);
+               applet_set_eoi(appctx);
                appctx->st0 = CLI_ST_END;
        }