From: Christopher Faulet Date: Mon, 26 May 2025 12:25:16 +0000 (+0200) Subject: BUG/MEDIUM: cli/ring: Properly handle shutdown in "show event" I/O handler X-Git-Tag: v3.2.0~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4d4da515f2287ec5db1ae251f0d8415cad10bd34;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: cli/ring: Properly handle shutdown in "show event" I/O handler The commit 03dc54d802 ("BUG/MINOR: ring: Fix I/O handler of "show event" command to not rely on the SC") introduced a regression. By removing dependencies on the SC, a test to detect client shutdowns was removed. So now, the CLI applet is no longer released when the client shut the connection during a "show event -w". So of course, we should not use the SC to detect the shutdowns. But the SE must be used insteead. It is a 3.2-specific issue, so no backport needed. --- diff --git a/src/ring.c b/src/ring.c index 5e3f23dab..9e3cd6e1c 100644 --- a/src/ring.c +++ b/src/ring.c @@ -710,7 +710,7 @@ int cli_io_handler_show_ring(struct appctx *appctx) /* we've drained everything and are configured to wait for more * data or an event (keypress, close) */ - if (!b_data(&appctx->inbuf)) { + if (!b_data(&appctx->inbuf) && !se_fl_test(appctx->sedesc, SE_FL_SHW)) { /* let's be woken up once new data arrive */ MT_LIST_APPEND(&ring->waiters, &appctx->wait_entry); ofs = ring_tail(ring);