From: Christopher Faulet Date: Tue, 21 Mar 2023 10:25:21 +0000 (+0100) Subject: MINOR: stconn: Always ack EOS at the end of sc_conn_recv() X-Git-Tag: v2.8-dev7~88 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b208d8cd64252c5ffee751216ff68b73c62666e3;p=thirdparty%2Fhaproxy.git MINOR: stconn: Always ack EOS at the end of sc_conn_recv() EOS is now acknowledge at the end of sc_conn_recv(), even if an error was encountered. There is no reason to not do so, especially because, if it not performed here, it will be ack in sc_conn_process(). Note, it is still performed in sc_conn_process() because this function is also the .wake callback function and can be directly called from the lower layer. --- diff --git a/src/stconn.c b/src/stconn.c index 134af8f420..918653d5c5 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1472,21 +1472,23 @@ static int sc_conn_recv(struct stconn *sc) ret = 1; } - if (sc_ep_test(sc, SE_FL_ERROR)) - ret = 1; - else if (sc_ep_test(sc, SE_FL_EOS)) { + if (sc_ep_test(sc, SE_FL_EOS)) { /* we received a shutdown */ if (ic->flags & CF_AUTO_CLOSE) channel_shutw_now(ic); sc_conn_read0(sc); ret = 1; } + + if (sc_ep_test(sc, SE_FL_ERROR)) + ret = 1; else if (!(sc->flags & (SC_FL_WONT_READ|SC_FL_NEED_BUFF|SC_FL_NEED_ROOM)) && !(ic->flags & CF_SHUTR)) { /* Subscribe to receive events if we're blocking on I/O */ conn->mux->subscribe(sc, SUB_RETRY_RECV, &sc->wait_event); se_have_no_more_data(sc->sedesc); - } else { + } + else { se_have_more_data(sc->sedesc); ret = 1; }