]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MEDIUM: stconn: Forbid applets with more to deliver if EOI was reached
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Apr 2023 07:45:41 +0000 (09:45 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 14 Apr 2023 15:05:53 +0000 (17:05 +0200)
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

index f6ca85aff95ac707ac2a2fd68bb56c5b7f951f32..1ec6172b0247aad5373a47d20b5e505af8193863 100644 (file)
@@ -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.
         */