From 407210a34d781f8249504557c371c170cb34f93e Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Tue, 14 Feb 2023 11:01:51 +0100 Subject: [PATCH] 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. --- src/stconn.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; } -- 2.39.5