]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: conn-stream: Add ISBACK conn-stream flag
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 25 Mar 2022 14:32:38 +0000 (15:32 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 13 Apr 2022 13:10:14 +0000 (15:10 +0200)
CS_FL_ISBACK is a new flag, set on backend conn-streams. We must just be
careful to preserve this flag when the endpoint is detached from the
conn-stream.

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

index ddfd879066d33b958827c3aeb984cd8efdb9a9ed..50f48b1fb85533cf214552ffd7505a7ec5e95288 100644 (file)
@@ -219,6 +219,7 @@ void show_cs_flags(unsigned int f)
                printf("0\n");
                return;
        }
+       SHOW_FLAG(f, CS_FL_ISBACK);
 
        if (f) {
                printf("EXTRA(0x%08x)", f);
index bde6600ca1b63b7ee1de0860216c70409f98489b..226d451fec5a64424f797caad44e66c2f558a142 100644 (file)
@@ -78,6 +78,7 @@ struct stream_interface;
 /* conn_stream flags */
 enum {
        CS_FL_NONE          = 0x00000000,  /* Just for initialization purposes */
+       CS_FL_ISBACK        = 0x00000001,  /* Set for CS on back-side */
 };
 
 /* cs_shutr() modes */
index bb5178448090addf36309889461468e19ec087f1..45c82efba3513b4c9810bb77c03f5c2785244372 100644 (file)
@@ -267,7 +267,7 @@ void cs_detach_endp(struct conn_stream *cs)
        /* FIXME: Rest CS for now but must be reviewed. CS flags are only
         *        connection related for now but this will evolved
         */
-       cs->flags = CS_FL_NONE;
+       cs->flags &= CS_FL_ISBACK;
        if (cs->si)
                cs->si->ops = &si_embedded_ops;
        cs->data_cb = NULL;
index b07de9bc07523477c5ec300c72f45a1565df08e7..535e5fa7f181a45d2529466f67a367deab251a35 100644 (file)
@@ -446,7 +446,7 @@ struct stream *stream_new(struct session *sess, struct conn_stream *cs, struct b
        if (cs_attach_strm(s->csf, s) < 0)
                goto out_fail_attach_csf;
 
-       s->csb = cs_new_from_strm(s, CS_FL_NONE);
+       s->csb = cs_new_from_strm(s, CS_FL_ISBACK);
        if (!s->csb)
                goto out_fail_alloc_csb;