From: Christopher Faulet Date: Tue, 7 Nov 2023 06:45:43 +0000 (+0100) Subject: BUG/MINOR: stconn: Sanitize report for read activity X-Git-Tag: v2.9-dev10~149 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c57af8ebcdd39bcef7c3edc2d1d6e11b6ef7f448;p=thirdparty%2Fhaproxy.git BUG/MINOR: stconn: Sanitize report for read activity When a EOS or EOI is detected on the endpoint and when the event is reported at the SC level, a read activity must be reported. It is not really a big deal because these flags already inhibit any read timeout. But it is consistent with the comment. In addition, no read activity is reported on abort. It is up-down event and it is not an event unblocking the reads. So there is no reason to report a read activity. This patch must be backported to 2.8. --- diff --git a/src/stconn.c b/src/stconn.c index 91c6eb728b..8ced6b8dde 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -558,7 +558,6 @@ static void sc_app_abort(struct stconn *sc) sc->flags |= SC_FL_ABRT_DONE; ic->flags |= CF_READ_EVENT; - sc_ep_report_read_activity(sc); if (!sc_state_in(sc->state, SC_SB_CON|SC_SB_RDY|SC_SB_EST)) return; @@ -1361,6 +1360,7 @@ static int sc_conn_recv(struct stconn *sc) * cannot be xferred to the channel */ ic->flags |= CF_READ_EVENT; + sc_ep_report_read_activity(sc); } if (ret <= 0) { @@ -1829,6 +1829,7 @@ static int sc_conn_process(struct stconn *sc) if (sc_ep_test(sc, SE_FL_EOI) && !(sc->flags & SC_FL_EOI)) { sc->flags |= SC_FL_EOI; ic->flags |= CF_READ_EVENT; + sc_ep_report_read_activity(sc); } if (sc_ep_test(sc, SE_FL_ERROR)) @@ -1882,6 +1883,7 @@ static void sc_applet_eos(struct stconn *sc) return; sc->flags |= SC_FL_EOS; ic->flags |= CF_READ_EVENT; + sc_ep_report_read_activity(sc); /* Note: on abort, we don't call the applet */