]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stconn: turn SE_FL_WILL_CONSUME to SE_FL_WONT_CONSUME
authorWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 14:43:52 +0000 (16:43 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 27 May 2022 17:33:35 +0000 (19:33 +0200)
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.

dev/flags/flags.c
include/haproxy/applet.h
include/haproxy/sc_strm.h
include/haproxy/stconn-t.h
include/haproxy/stconn.h

index 6879ecb2cf3a05e438625b897f8d552ebe1bdd0f..b53df6c119d604eee7106e72002635d74223c817 100644 (file)
@@ -186,7 +186,7 @@ void show_endp_flags(unsigned int f)
 
        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);
index 01835d7d2970dd9beec9402c34e88fdbc5da476a..eaea8d138ea408658908216c5586d2f164eb23a8 100644 (file)
@@ -149,7 +149,7 @@ static inline void applet_have_no_more_data(struct appctx *appctx)
  */
 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_will_consume(struct appctx *appctx)
  */
 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_wont_consume(struct appctx *appctx)
  */
 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
index 151d1919170aa11a07a82b33ee7e152c9aefb4c3..82c583a6052cf621626d94581980815857edd4f6 100644 (file)
@@ -378,7 +378,7 @@ static inline int sc_is_send_allowed(const struct stconn *sc)
        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 */
index ae17def422f5318865e7de92d3f4546d06f86ecc..0aa2178ab770dfa3f51ef6ea3b8e5cc33683da2f 100644 (file)
@@ -72,7 +72,7 @@ enum se_flags {
        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,*/
index f24096999c0af1fc4be65cf46ab283d1a8d91004..9c7be5032b2ba89805479042a279a9a9d4f944af 100644 (file)
@@ -378,7 +378,7 @@ static inline void sc_need_room(struct stconn *sc)
  */
 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_will_consume(struct sedesc *se)
  */
 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_wont_consume(struct sedesc *se)
  */
 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 */