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.
This commit is contained in:
Christopher Faulet 2025-05-26 14:25:16 +02:00
parent 99e755d673
commit 4d4da515f2

View File

@ -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);