From: Christopher Faulet Date: Tue, 21 Mar 2023 13:19:08 +0000 (+0100) Subject: MINOR: stconn/applet: Handle EOS in the applet .wake callback function X-Git-Tag: v2.8-dev7~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ffc9d7be33edbb08ca32587c99102a758b3c0ea;p=thirdparty%2Fhaproxy.git MINOR: stconn/applet: Handle EOS in the applet .wake callback function 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. --- diff --git a/src/stconn.c b/src/stconn.c index 1aaf9572f0..1e2ca265eb 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -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. */