From e8bcef5f2277b76e053415cf67b3cbbab78adc29 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 14 Apr 2023 09:45:41 +0200 Subject: [PATCH] MEDIUM: stconn: Forbid applets with more to deliver if EOI was reached When an applet is woken up, before calling its io_handler, we pretend it has no more data to deliver. So, after the io_handler execution, it is a bug if an applet states it has more data to deliver while the end of input is reached. So a BUG_ON() is added to be sure it never happens. --- src/stconn.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stconn.c b/src/stconn.c index f6ca85a..1ec6172 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1847,6 +1847,8 @@ static int sc_applet_process(struct stconn *sc) sc_abort(sc); } + BUG_ON(sc_ep_test(sc, SE_FL_HAVE_NO_DATA|SE_FL_EOI) == SE_FL_EOI); + /* If the applet wants to write and the channel is closed, it's a * broken pipe and it must be reported. */ -- 1.7.10.4