From: Christopher Faulet Date: Fri, 17 Nov 2023 14:26:57 +0000 (+0100) Subject: BUG/MINOR: stconn/applet: Report send activity only if there was output data X-Git-Tag: v2.9-dev10~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7676a2cdf6ceb3fa68156f7c47ade5e23c4094fd;p=thirdparty%2Fhaproxy.git BUG/MINOR: stconn/applet: Report send activity only if there was output data For applets and connection, when a send attempt is performed, we must be sure to not report a send activity if there was no output data at all before the attempt. It is not important for the date itself but for the date for non-independent stream. This patch must be backported to 2.8. --- diff --git a/src/applet.c b/src/applet.c index e7bf088775..a5b0946b9a 100644 --- a/src/applet.c +++ b/src/applet.c @@ -462,7 +462,6 @@ 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); did_send = 1; } else { @@ -477,8 +476,10 @@ struct task *task_run_applet(struct task *t, void *context, unsigned int state) sc_ep_set(sc, SE_FL_EOS|SE_FL_ERROR); } - if (!co_data(sc_oc(sc))) - sc_ep_report_send_activity(sc); + if (!co_data(sc_oc(sc))) { + if (did_send) + sc_ep_report_send_activity(sc); + } else sc_ep_report_blocked_send(sc, did_send); diff --git a/src/stconn.c b/src/stconn.c index d408e3cd20..896d7e3ec1 100644 --- a/src/stconn.c +++ b/src/stconn.c @@ -1704,6 +1704,8 @@ static int sc_conn_send(struct stconn *sc) /* FIXME: Must be reviewed for FF */ if (!co_data(oc) && !sc_ep_have_ff_data(sc)) { + if (did_send) + sc_ep_report_send_activity(sc); /* If fast-forwarding is blocked, unblock it now to check for * receive on the other side */ @@ -1712,7 +1714,6 @@ static int sc_conn_send(struct stconn *sc) sc_have_room(sco); did_send = 1; } - sc_ep_report_send_activity(sc); } else { /* We couldn't send all of our data, let the mux know we'd like to send more */