From: Christopher Faulet Date: Wed, 30 Mar 2022 13:43:23 +0000 (+0200) Subject: MINOR: stream-int: Remove SI_FL_INDEP_STR to rely on CS flags instead X-Git-Tag: v2.6-dev6~79 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a728518c15be3786eba980e82cfa4718688c2a6a;p=thirdparty%2Fhaproxy.git MINOR: stream-int: Remove SI_FL_INDEP_STR to rely on CS flags instead 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. --- diff --git a/dev/flags/flags.c b/dev/flags/flags.c index 6a8b5ab36a..318f3946ec 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_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); diff --git a/include/haproxy/conn_stream-t.h b/include/haproxy/conn_stream-t.h index 60cd9fa6d7..b8f72b8902 100644 --- a/include/haproxy/conn_stream-t.h +++ b/include/haproxy/conn_stream-t.h @@ -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 */ diff --git a/include/haproxy/stream_interface-t.h b/include/haproxy/stream_interface-t.h index 6ffc3d4c68..12a32bd661 100644 --- a/include/haproxy/stream_interface-t.h +++ b/include/haproxy/stream_interface-t.h @@ -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 */ diff --git a/src/proxy.c b/src/proxy.c index 70710d0235..0dcc830187 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -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; diff --git a/src/stream.c b/src/stream.c index c2e0b24ddc..7a4dfef7f3 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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; diff --git a/src/stream_interface.c b/src/stream_interface.c index 66f4980ced..1198215e0b 100644 --- a/src/stream_interface.c +++ b/src/stream_interface.c @@ -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",