diff --git a/include/haproxy/applet.h b/include/haproxy/applet.h index 5acdfdb20..e610ba4f6 100644 --- a/include/haproxy/applet.h +++ b/include/haproxy/applet.h @@ -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. diff --git a/include/haproxy/stconn.h b/include/haproxy/stconn.h index 27e61071b..5ee73d0f2 100644 --- a/include/haproxy/stconn.h +++ b/include/haproxy/stconn.h @@ -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); }