]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: applet: Report a send activity everytime data were sent
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 10 Oct 2023 16:23:05 +0000 (18:23 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 13 Oct 2023 08:35:32 +0000 (10:35 +0200)
In the same way than for stream-connectors (see "BUG/MEDIUM: stconn: Report
a send activity everytime data were sent" for details), we now report a send
activity everytime something was consumed by an applet, even if some output
data remains blocked into the channel's buffer.

This patch must be backported to 2.8.

src/applet.c

index a936600a148e3bb30329eafea93de02e7d7baea7..cdcbc2556fdbd3024bb8530611d4b48e8f5de54e 100644 (file)
@@ -458,9 +458,13 @@ struct task *task_run_applet(struct task *t, void *context, unsigned int state)
                sc_oc(sc)->flags |= CF_WRITE_EVENT | CF_WROTE_DATA;
                if (sco->room_needed < 0 || channel_recv_max(sc_oc(sc)) >= sco->room_needed)
                        sc_have_room(sco);
+               sc_ep_report_send_activity(sc);
+       }
+       else {
+               if (!sco->room_needed)
+                       sc_have_room(sco);
+               sc_ep_report_blocked_send(sc);
        }
-       else if (!sco->room_needed)
-               sc_have_room(sco);
 
        if (sc_ic(sc)->flags & CF_READ_EVENT)
                sc_ep_report_read_activity(sc);
@@ -468,11 +472,6 @@ struct task *task_run_applet(struct task *t, void *context, unsigned int state)
        if (sc_waiting_room(sc) && (sc->flags & SC_FL_ABRT_DONE)) {
                sc_ep_set(sc, SE_FL_EOS|SE_FL_ERROR);
        }
-       else if (channel_is_empty(sc_oc(sc)))
-               sc_ep_report_send_activity(sc);
-       else {
-               sc_ep_report_blocked_send(sc);
-       }
 
        /* measure the call rate and check for anomalies when too high */
        if (((b_size(sc_ib(sc)) && sc->flags & SC_FL_NEED_BUFF) || // asks for a buffer which is present