]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stconn: Sanitize report for read activity
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Nov 2023 06:45:43 +0000 (07:45 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 7 Nov 2023 09:41:11 +0000 (10:41 +0100)
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 <lra> 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.

src/stconn.c

index 91c6eb728bb310e2ee3078f7d3fe070af1534ce2..8ced6b8ddefcd587982045d4499ea507a2fc6849 100644 (file)
@@ -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 */