]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stconn/applet: Handle EOS in the applet .wake callback function
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 21 Mar 2023 13:19:08 +0000 (14:19 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 Apr 2023 06:57:05 +0000 (08:57 +0200)
Just like for end of input, the end of stream reported by the endpoint
(SE_FL_EOS flag) is now handled in sc_applet_process(). The idea is to have
applets acting as muxes by reporting events through the SE descriptor, as
far as possible.

src/stconn.c

index 1aaf9572f04d8a614da8c8438f9b79a7077befff..1e2ca265eba8026dbcd7f3a146faeb233eb38924 100644 (file)
@@ -1829,6 +1829,11 @@ static int sc_applet_process(struct stconn *sc)
                ic->flags |= (CF_EOI|CF_READ_EVENT);
        }
 
+       if (sc_ep_test(sc, SE_FL_EOS)) {
+               /* we received a shutdown */
+               sc_shutr(sc);
+       }
+
        /* If the applet wants to write and the channel is closed, it's a
         * broken pipe and it must be reported.
         */