From: Christopher Faulet Date: Fri, 25 Mar 2022 14:32:38 +0000 (+0100) Subject: MINOR: conn-stream: Add ISBACK conn-stream flag X-Git-Tag: v2.6-dev6~96 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30995115715cf600df107d29c5661f62f7c5b1de;p=thirdparty%2Fhaproxy.git MINOR: conn-stream: Add ISBACK conn-stream flag 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. --- diff --git a/dev/flags/flags.c b/dev/flags/flags.c index ddfd879066..50f48b1fb8 100644 --- a/dev/flags/flags.c +++ b/dev/flags/flags.c @@ -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); diff --git a/include/haproxy/conn_stream-t.h b/include/haproxy/conn_stream-t.h index bde6600ca1..226d451fec 100644 --- a/include/haproxy/conn_stream-t.h +++ b/include/haproxy/conn_stream-t.h @@ -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 */ diff --git a/src/conn_stream.c b/src/conn_stream.c index bb51784480..45c82efba3 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -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; diff --git a/src/stream.c b/src/stream.c index b07de9bc07..535e5fa7f1 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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;