From 4d4da515f2287ec5db1ae251f0d8415cad10bd34 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 26 May 2025 14:25:16 +0200 Subject: [PATCH] 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. --- src/ring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);