]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: stconn: Don't rearm the read expiration date if EOI was reached
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 14 Feb 2023 10:01:51 +0000 (11:01 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 17 Feb 2023 09:16:25 +0000 (10:16 +0100)
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.

src/stconn.c

index d8e7f8b9cf3338ed63e2803c90f3c51c84050999..6dfdfaff43eebb18833b4d160a65ea11aedad599 100644 (file)
@@ -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;
        }