From: Christopher Faulet Date: Tue, 14 Feb 2023 10:01:51 +0000 (+0100) Subject: BUG/MEDIUM: stconn: Don't rearm the read expiration date if EOI was reached X-Git-Tag: v2.8-dev5~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=407210a34;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: stconn: Don't rearm the read expiration date if EOI was reached At the stream level, the read expiration date is unset if a shutr was received but not if the end of input was reached. If we know no more data are excpected, there is no reason to let the read expiration date armed, except to respect clientfin/serverfin timeout on some circumstances. This patch could slowly be backported as far as 2.2. --- diff --git a/src/stconn.c b/src/stconn.c index d8e7f8b9cf..6dfdfaff43 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1041,7 +1041,7 @@ void sc_update_rx(struct stconn *sc) else sc_will_read(sc); - if (sc->flags & (SC_FL_WONT_READ|SC_FL_NEED_BUFF|SC_FL_NEED_ROOM)) + if ((ic->flags & CF_EOI) || sc->flags & (SC_FL_WONT_READ|SC_FL_NEED_BUFF|SC_FL_NEED_ROOM)) ic->rex = TICK_ETERNITY; else if (!(ic->flags & CF_READ_NOEXP) && !tick_isset(ic->rex)) ic->rex = tick_add_ifset(now_ms, ic->rto); @@ -1189,7 +1189,7 @@ static void sc_notify(struct stconn *sc) sc_chk_rcv(sc); sc_chk_rcv(sco); - if (ic->flags & CF_SHUTR || sc_ep_test(sc, SE_FL_APPLET_NEED_CONN) || + if (ic->flags & (CF_EOI|CF_SHUTR) || sc_ep_test(sc, SE_FL_APPLET_NEED_CONN) || (sc->flags & (SC_FL_WONT_READ|SC_FL_NEED_BUFF|SC_FL_NEED_ROOM))) { ic->rex = TICK_ETERNITY; }