]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stconn/applet: Handle EOI in the applet .wake callback function
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Mar 2023 10:49:21 +0000 (11:49 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Apr 2023 06:57:05 +0000 (08:57 +0200)
The end of input reported by the endpoint (SE_FL_EOI flag), is now handled
in sc_applet_process(). This function is always called after an applet was
called. So, the applets can now only report EOI on the SE descriptor and
have no reason to update the channel too.

src/stconn.c

index 918653d5c50bd4fb162acb98e83691a0855b5367..1aaf9572f04d8a614da8c8438f9b79a7077befff 100644 (file)
@@ -1822,6 +1822,13 @@ static int sc_applet_process(struct stconn *sc)
 
        BUG_ON(!sc_appctx(sc));
 
+       /* Report EOI on the channel if it was reached from the applet point of
+        * view. */
+       if (sc_ep_test(sc, SE_FL_EOI) && !(ic->flags & CF_EOI)) {
+               sc_ep_report_read_activity(sc);
+               ic->flags |= (CF_EOI|CF_READ_EVENT);
+       }
+
        /* If the applet wants to write and the channel is closed, it's a
         * broken pipe and it must be reported.
         */