MINOR: stconn: Report a send activity when endpoint is willing to consume data

When the endpoint (applet or mux) is now willing to consume data while it
said it wouldn't, a send activity is reported. Indeed, the writes was
blocked because of the endpoint. It is now ready to consume outgoing
data. So an send activity must be reported to reset corresponding timers.

Concretly, when the flag SE_FL_WONT_CONSULE is removed, a send activity is
reported.
This commit is contained in:
Christopher Faulet 2023-02-27 16:32:30 +01:00
parent e758b5c703
commit 8aabc8ebfd
2 changed files with 12 additions and 10 deletions

View File

@ -141,29 +141,28 @@ static inline void applet_have_no_more_data(struct appctx *appctx)
}
/* The applet indicates that it's ready to consume data from the stream's
* output buffer.
* output buffer. Rely on the corresponding SE function
*/
static inline void applet_will_consume(struct appctx *appctx)
{
se_fl_clr(appctx->sedesc, SE_FL_WONT_CONSUME);
se_will_consume(appctx->sedesc);
}
/* The applet indicates that it's not willing to consume data from the stream's
* output buffer.
* output buffer. Rely on the corresponding SE function
*/
static inline void applet_wont_consume(struct appctx *appctx)
{
se_fl_set(appctx->sedesc, SE_FL_WONT_CONSUME);
se_wont_consume(appctx->sedesc);
}
/* The applet indicates that it's willing to consume data from the stream's
* output buffer, but that there's not enough, so it doesn't want to be woken
* up until more are presented.
* up until more are presented. Rely on the corresponding SE function
*/
static inline void applet_need_more_data(struct appctx *appctx)
{
se_fl_clr(appctx->sedesc, SE_FL_WONT_CONSUME);
se_fl_set(appctx->sedesc, SE_FL_WAIT_DATA);
se_need_more_data(appctx->sedesc);
}
/* The applet indicates that it does not expect data from the opposite endpoint.

View File

@ -448,11 +448,14 @@ static inline void sc_need_room(struct stconn *sc)
}
/* The stream endpoint indicates that it's ready to consume data from the
* stream's output buffer.
* stream's output buffer. Report a send activity if the SE is unblocked.
*/
static inline void se_will_consume(struct sedesc *se)
{
se_fl_clr(se, SE_FL_WONT_CONSUME);
if (se_fl_test(se, SE_FL_WONT_CONSUME)) {
se_fl_clr(se, SE_FL_WONT_CONSUME);
sc_ep_report_send_activity(se->sc);
}
}
/* The stream endpoint indicates that it's not willing to consume data from the
@ -469,7 +472,7 @@ static inline void se_wont_consume(struct sedesc *se)
*/
static inline void se_need_more_data(struct sedesc *se)
{
se_fl_clr(se, SE_FL_WONT_CONSUME);
se_will_consume(se);
se_fl_set(se, SE_FL_WAIT_DATA);
}