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 <fsb> date itself but for the <lra> date for
non-independent stream.

This patch must be backported to 2.8.
This commit is contained in:
Christopher Faulet 2023-11-17 15:26:57 +01:00
parent ab5ecaa2ea
commit 7676a2cdf6
2 changed files with 6 additions and 4 deletions

View File

@ -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);

View File

@ -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 */