MINOR: stconn: turn SE_FL_WILL_CONSUME to SE_FL_WONT_CONSUME
This flag was the only remaining one that was inverted as a blocking
condition, requiring special handling to preset it on sedesc allocation.
Let's flip it in its definition and accessors.
diff --git a/dev/flags/flags.c b/dev/flags/flags.c
index 6879ecb..b53df6c 100644
--- a/dev/flags/flags.c
+++ b/dev/flags/flags.c
@@ -186,7 +186,7 @@
SHOW_FLAG(f, SE_FL_APPLET_NEED_CONN);
SHOW_FLAG(f, SE_FL_HAVE_NO_DATA);
- SHOW_FLAG(f, SE_FL_WILL_CONSUME);
+ SHOW_FLAG(f, SE_FL_WONT_CONSUME);
SHOW_FLAG(f, SE_FL_WAIT_DATA);
SHOW_FLAG(f, SE_FL_KILL_CONN);
SHOW_FLAG(f, SE_FL_WAIT_FOR_HS);
diff --git a/include/haproxy/applet.h b/include/haproxy/applet.h
index 01835d7..eaea8d1 100644
--- a/include/haproxy/applet.h
+++ b/include/haproxy/applet.h
@@ -149,7 +149,7 @@
*/
static inline void applet_will_consume(struct appctx *appctx)
{
- se_fl_set(appctx->sedesc, SE_FL_WILL_CONSUME);
+ se_fl_clr(appctx->sedesc, SE_FL_WONT_CONSUME);
}
/* The applet indicates that it's not willing to consume data from the stream's
@@ -157,7 +157,7 @@
*/
static inline void applet_wont_consume(struct appctx *appctx)
{
- se_fl_clr(appctx->sedesc, SE_FL_WILL_CONSUME);
+ se_fl_set(appctx->sedesc, SE_FL_WONT_CONSUME);
}
/* The applet indicates that it's willing to consume data from the stream's
@@ -166,7 +166,8 @@
*/
static inline void applet_need_more_data(struct appctx *appctx)
{
- se_fl_set(appctx->sedesc, SE_FL_WILL_CONSUME | SE_FL_WAIT_DATA);
+ se_fl_clr(appctx->sedesc, SE_FL_WONT_CONSUME);
+ se_fl_set(appctx->sedesc, SE_FL_WAIT_DATA);
}
/* writes chunk <chunk> into the input channel of the stream attached to this
diff --git a/include/haproxy/sc_strm.h b/include/haproxy/sc_strm.h
index 151d191..82c583a 100644
--- a/include/haproxy/sc_strm.h
+++ b/include/haproxy/sc_strm.h
@@ -378,7 +378,7 @@
if (oc->flags & CF_SHUTW)
return 0;
- return (sc_ep_get(sc) & (SE_FL_WAIT_DATA|SE_FL_WILL_CONSUME)) == SE_FL_WILL_CONSUME;
+ return !sc_ep_test(sc, SE_FL_WAIT_DATA | SE_FL_WONT_CONSUME);
}
#endif /* _HAPROXY_SC_STRM_H */
diff --git a/include/haproxy/stconn-t.h b/include/haproxy/stconn-t.h
index ae17def..0aa2178 100644
--- a/include/haproxy/stconn-t.h
+++ b/include/haproxy/stconn-t.h
@@ -72,7 +72,7 @@
SE_FL_WAIT_FOR_HS = 0x00200000, /* This stream is waiting for handhskae */
SE_FL_KILL_CONN = 0x00400000, /* must kill the connection when the SC closes */
SE_FL_WAIT_DATA = 0x00800000, /* stream endpoint cannot work without more data from the stream's output */
- SE_FL_WILL_CONSUME = 0x01000000, /* stream endpoint is interested in consuming more data */
+ SE_FL_WONT_CONSUME = 0x01000000, /* stream endpoint will not consume more data */
SE_FL_HAVE_NO_DATA = 0x02000000, /* the endpoint has no more data to deliver to the stream */
SE_FL_APP_MASK = 0x02e00000, /* Mask for flags set by the app layer */
/* unused 0x04000000,*/
diff --git a/include/haproxy/stconn.h b/include/haproxy/stconn.h
index f240969..9c7be50 100644
--- a/include/haproxy/stconn.h
+++ b/include/haproxy/stconn.h
@@ -378,7 +378,7 @@
*/
static inline void se_will_consume(struct sedesc *se)
{
- se_fl_set(se, SE_FL_WILL_CONSUME);
+ se_fl_clr(se, SE_FL_WONT_CONSUME);
}
/* The stream endpoint indicates that it's not willing to consume data from the
@@ -386,7 +386,7 @@
*/
static inline void se_wont_consume(struct sedesc *se)
{
- se_fl_clr(se, SE_FL_WILL_CONSUME);
+ se_fl_set(se, SE_FL_WONT_CONSUME);
}
/* The stream endpoint indicates that it's willing to consume data from the
@@ -395,7 +395,8 @@
*/
static inline void se_need_more_data(struct sedesc *se)
{
- se_fl_set(se, SE_FL_WILL_CONSUME | SE_FL_WAIT_DATA);
+ se_fl_clr(se, SE_FL_WONT_CONSUME);
+ se_fl_set(se, SE_FL_WAIT_DATA);
}
#endif /* _HAPROXY_STCONN_H */