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.
This commit is contained in:
Christopher Faulet 2022-03-25 15:32:38 +01:00
parent 1bceee21e3
commit 3099511571
4 changed files with 4 additions and 2 deletions

View 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);

View 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 */

View 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;

View 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;