]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: stream-int: Remove SI_FL_INDEP_STR to rely on CS flags instead
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 30 Mar 2022 13:43:23 +0000 (15:43 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Apr 2022 13:10:14 +0000 (15:10 +0200)
Flag to consider a stream as indepenent is now handled at the conn-stream
level. Thus SI_FL_INDEP_STR stream-int flag is replaced by CS_FL_INDEP_STR
conn-stream flags.

dev/flags/flags.c
include/haproxy/conn_stream-t.h
include/haproxy/stream_interface-t.h
src/proxy.c
src/stream.c
src/stream_interface.c

index 6a8b5ab36ad4d2ab49fa4e6d419dfe72b0ff3469..318f3946ec0cbda92a168956b62622f1b4f195ba 100644 (file)
@@ -219,6 +219,7 @@ void show_cs_flags(unsigned int f)
                printf("0\n");
                return;
        }
+       SHOW_FLAG(f, CS_FL_INDEP_STR);
        SHOW_FLAG(f, CS_FL_DONT_WAKE);
        SHOW_FLAG(f, CS_FL_NOLINGER);
        SHOW_FLAG(f, CS_FL_NOHALF);
@@ -268,7 +269,6 @@ void show_si_flags(unsigned int f)
 
        SHOW_FLAG(f, SI_FL_WAIT_DATA);
        SHOW_FLAG(f, SI_FL_ISBACK);
-       SHOW_FLAG(f, SI_FL_INDEP_STR);
        SHOW_FLAG(f, SI_FL_SRC_ADDR);
        SHOW_FLAG(f, SI_FL_WANT_GET);
        SHOW_FLAG(f, SI_FL_CLEAN_ABRT);
index 60cd9fa6d7f7ac3ab1661ecbfaad7e82b6b8b9d3..b8f72b890232370b5f666b58d98f2548cf312dd0 100644 (file)
@@ -86,6 +86,7 @@ enum {
        CS_FL_NOLINGER      = 0x00000008,  /* may close without lingering. One-shot. */
        CS_FL_NOHALF        = 0x00000010,  /* no half close, close both sides at once */
        CS_FL_DONT_WAKE     = 0x00000020,  /* resync in progress, don't wake up */
+       CS_FL_INDEP_STR     = 0x00000040,  /* independent streams = don't update rex on write */
 };
 
 /* cs_shutr() modes */
index 6ffc3d4c68c8bbbc8f971498c468a8c9bd40408d..12a32bd661a7d12fb569a84df4a5fba038e6a600 100644 (file)
@@ -86,7 +86,6 @@ enum {
        /* unused: 0x00000001, 0x00000002 */
        SI_FL_WAIT_DATA  = 0x00000008,  /* stream-int waits for more outgoing data to send */
        SI_FL_ISBACK     = 0x00000010,  /* 0 for front-side SI, 1 for back-side */
-       SI_FL_INDEP_STR  = 0x00000040,  /* independent streams = don't update rex on write */
        SI_FL_SRC_ADDR   = 0x00001000,  /* get the source ip/port with getsockname */
        /* unused: 0x00000200 */
        SI_FL_WANT_GET   = 0x00004000,  /* a stream-int would like to get some data from the buffer */
index 70710d023597697b56272f5bd1215ae5927b9e9b..0dcc83018725aac3e5b5baf7f378ed43ceecbf04 100644 (file)
@@ -2305,9 +2305,9 @@ int stream_set_backend(struct stream *s, struct proxy *be)
        proxy_inc_be_ctr(be);
 
        /* assign new parameters to the stream from the new backend */
-       cs_si(s->csb)->flags &= ~SI_FL_INDEP_STR;
+       s->csb->flags &= ~CS_FL_INDEP_STR;
        if (be->options2 & PR_O2_INDEPSTR)
-               cs_si(s->csb)->flags |= SI_FL_INDEP_STR;
+               s->csb->flags |= CS_FL_INDEP_STR;
 
        if (tick_isset(be->timeout.serverfin))
                s->csb->hcto = be->timeout.serverfin;
index c2e0b24ddc22d5770a267518cc4459c6000cd214..7a4dfef7f397710526d90666c10008157fb2400c 100644 (file)
@@ -458,12 +458,12 @@ struct stream *stream_new(struct session *sess, struct conn_stream *cs, struct b
        s->csf->hcto = sess->fe->timeout.clientfin;
 
        if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
-               cs_si(s->csf)->flags |= SI_FL_INDEP_STR;
+               s->csf->flags |= CS_FL_INDEP_STR;
 
        cs_si(s->csb)->flags = SI_FL_ISBACK;
        s->csb->hcto = TICK_ETERNITY;
        if (likely(sess->fe->options2 & PR_O2_INDEPSTR))
-               cs_si(s->csb)->flags |= SI_FL_INDEP_STR;
+               s->csb->flags |= CS_FL_INDEP_STR;
 
        if (cs->endp->flags & CS_EP_WEBSOCKET)
                s->flags |= SF_WEBSOCKET;
index 66f4980cedafddf2b00dff5522ad1262f9c351ad..1198215e0bc2a2f664ccd71cd10ff8c87f799c89 100644 (file)
@@ -459,7 +459,7 @@ static void stream_int_notify(struct stream_interface *si)
                        if (tick_isset(oc->wex))
                                oc->wex = tick_add_ifset(now_ms, oc->wto);
 
-               if (!(si->flags & SI_FL_INDEP_STR))
+               if (!(si->cs->flags & CS_FL_INDEP_STR))
                        if (tick_isset(ic->rex))
                                ic->rex = tick_add_ifset(now_ms, ic->rto);
        }
@@ -912,7 +912,7 @@ void si_update_tx(struct stream_interface *si)
        si->flags &= ~SI_FL_WAIT_DATA;
        if (!tick_isset(oc->wex)) {
                oc->wex = tick_add_ifset(now_ms, oc->wto);
-               if (tick_isset(ic->rex) && !(si->flags & SI_FL_INDEP_STR)) {
+               if (tick_isset(ic->rex) && !(si->cs->flags & CS_FL_INDEP_STR)) {
                        /* Note: depending on the protocol, we don't know if we're waiting
                         * for incoming data or not. So in order to prevent the socket from
                         * expiring read timeouts during writes, we refresh the read timeout,
@@ -1216,7 +1216,7 @@ static void stream_int_chk_snd_conn(struct stream_interface *si)
                    !channel_is_empty(oc))
                        oc->wex = tick_add_ifset(now_ms, oc->wto);
 
-               if (tick_isset(ic->rex) && !(si->flags & SI_FL_INDEP_STR)) {
+               if (tick_isset(ic->rex) && !(cs->flags & CS_FL_INDEP_STR)) {
                        /* Note: to prevent the client from expiring read timeouts
                         * during writes, we refresh it. We only do this if the
                         * interface is not configured for "independent streams",