]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: cli: make sure to always print a pending message after release()
authorWilly Tarreau <w@1wt.eu>
Thu, 8 Feb 2024 16:22:41 +0000 (17:22 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 8 Feb 2024 17:22:35 +0000 (18:22 +0100)
If a release handler produces a final message, it's currently left
pending in the CLI context and needs another I/O event to be dumped
because immediately after calling ->release, we check for states
OUTPUT and above and we wait until more data arrives.

This patch adds continue statement to go back to the loop immediately
after leaving the release handler in order to attempt to emit the
output message.

At this point it's not sure whether any release handlers are producing
messages, so it's probably not needed to backport this.

src/cli.c

index ec5ae44c58c99bb728f1625c0f51e825cbdf9c65..cbfec88dfe1e6c2ffe6d82c2db9c1559564e26fb 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -1150,6 +1150,10 @@ static void cli_io_handler(struct appctx *appctx)
                                                if (appctx->io_release) {
                                                        appctx->io_release(appctx);
                                                        appctx->io_release = NULL;
+                                                       /* some release handlers might have
+                                                        * pending output to print.
+                                                        */
+                                                       continue;
                                                }
                                        }
                                break;