se_fl_set(appctx->sedesc, SE_FL_HAVE_NO_DATA);
}
+/* The applet indicates that it's ready to consume data from the stream's
+ * output buffer.
+ */
+static inline void applet_will_consume(struct appctx *appctx)
+{
+ se_fl_set(appctx->sedesc, SE_FL_WILL_CONSUME);
+}
+
+/* The applet indicates that it's not willing to consume data from the stream's
+ * output buffer.
+ */
+static inline void applet_wont_consume(struct appctx *appctx)
+{
+ se_fl_clr(appctx->sedesc, SE_FL_WILL_CONSUME);
+}
+
/* writes chunk <chunk> into the input channel of the stream attached to this
* appctx's endpoint, and marks the SC_FL_NEED_ROOM on a channel full error.
* See ci_putchk() for the list of return codes.
sc->flags |= SC_FL_NEED_ROOM;
}
-/* Report that a stream connector wants to get some data from the output buffer */
-static inline void cs_want_get(struct stconn *cs)
+/* The stream endpoint indicates that it's ready to consume data from the
+ * stream's output buffer.
+ */
+static inline void se_will_consume(struct sedesc *se)
{
- sc_ep_set(cs, SE_FL_WILL_CONSUME);
+ se_fl_set(se, SE_FL_WILL_CONSUME);
}
-/* Report that a stream connector failed to get some data from the output buffer */
-static inline void cs_cant_get(struct stconn *cs)
+/* The stream endpoint indicates that it's not willing to consume data from the
+ * stream's output buffer.
+ */
+static inline void se_wont_consume(struct sedesc *se)
{
- sc_ep_set(cs, SE_FL_WILL_CONSUME | SE_FL_WAIT_DATA);
+ se_fl_clr(se, SE_FL_WILL_CONSUME);
}
-/* Report that a stream connector doesn't want to get data from the output buffer */
-static inline void cs_stop_get(struct stconn *cs)
+/* Report that a stream connector failed to get some data from the output buffer */
+static inline void cs_cant_get(struct stconn *cs)
{
- sc_ep_clr(cs, SE_FL_WILL_CONSUME);
+ sc_ep_set(cs, SE_FL_WILL_CONSUME | SE_FL_WAIT_DATA);
}
#endif /* _HAPROXY_CONN_STREAM_H */
*/
htx_to_buf(res_htx, &res->buf);
if (!channel_is_empty(res))
- cs_stop_get(cs);
+ applet_wont_consume(appctx);
}
/* Dump all fields from <info> into <out> using the "show info" format (name: value) */