From 9d749374ea7283f2757f9154a5ec26852f07e3fa Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Tue, 3 Feb 2026 07:21:38 +0100 Subject: [PATCH] MINOR: streams: Remove SF_CURR_SESS The SF_CURR_SESS flag was used to indicate that the stream incremented cur_sess. Now that cur_sess is gone, the flag is no longer needed. --- include/haproxy/stream-t.h | 6 +++--- src/backend.c | 4 ---- src/cli.c | 5 +---- src/http_ana.c | 3 --- src/stream.c | 9 --------- 5 files changed, 4 insertions(+), 23 deletions(-) diff --git a/include/haproxy/stream-t.h b/include/haproxy/stream-t.h index b4677cb2f..a01048574 100644 --- a/include/haproxy/stream-t.h +++ b/include/haproxy/stream-t.h @@ -46,7 +46,7 @@ #define SF_FORCE_PRST 0x00000010 /* force persistence here, even if server is down */ #define SF_MONITOR 0x00000020 /* this stream comes from a monitoring system */ -#define SF_CURR_SESS 0x00000040 /* a connection is currently being counted on the server */ +/* 0x00000040 unused */ #define SF_CONN_EXP 0x00000080 /* timeout has expired */ #define SF_REDISP 0x00000100 /* set if this stream was redispatched from one server to another */ #define SF_IGNORE 0x00000200 /* The stream lead to a mux upgrade, and should be ignored */ @@ -120,8 +120,8 @@ static forceinline char *strm_show_flags(char *buf, size_t len, const char *deli _e(SF_ERR_MASK, SF_ERR_UP, _e(SF_ERR_MASK, SF_ERR_CHK_PORT)))))))))))); _(SF_DIRECT, _(SF_ASSIGNED, _(SF_MAYALLOC, _(SF_BE_ASSIGNED, _(SF_FORCE_PRST, - _(SF_MONITOR, _(SF_CURR_SESS, _(SF_CONN_EXP, _(SF_REDISP, - _(SF_IGNORE, _(SF_REDIRECTABLE, _(SF_HTX)))))))))))); + _(SF_MONITOR, _(SF_CONN_EXP, _(SF_REDISP, + _(SF_IGNORE, _(SF_REDIRECTABLE, _(SF_HTX))))))))))); /* epilogue */ _(~0U); diff --git a/src/backend.c b/src/backend.c index 3ed03dd41..4b485b46d 100644 --- a/src/backend.c +++ b/src/backend.c @@ -2276,7 +2276,6 @@ int connect_server(struct stream *s) s->conn_exp = tick_add_ifset(now_ms, s->connect_timeout); if (srv) { - s->flags |= SF_CURR_SESS; if (s->be->lbprm.server_take_conn) s->be->lbprm.server_take_conn(srv); } @@ -2783,9 +2782,6 @@ void back_handle_st_cer(struct stream *s) health_adjust(__objt_server(s->target), HANA_STATUS_L4_ERR); - if (s->flags & SF_CURR_SESS) - s->flags &= ~SF_CURR_SESS; - if ((sc->flags & SC_FL_ERROR) && conn && conn->err_code == CO_ER_SSL_MISMATCH_SNI) { /* We tried to connect to a server which is configured diff --git a/src/cli.c b/src/cli.c index 8fac95e4e..75c35912e 100644 --- a/src/cli.c +++ b/src/cli.c @@ -3534,9 +3534,6 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit) stream_del_srv_conn(s); if (objt_server(s->target)) { - if (s->flags & SF_CURR_SESS) { - s->flags &= ~SF_CURR_SESS; - } if (may_dequeue_tasks(__objt_server(s->target), be)) process_srv_queue(__objt_server(s->target)); } @@ -3566,7 +3563,7 @@ int pcli_wait_for_response(struct stream *s, struct channel *rep, int an_bit) s->res.to_forward = 0; s->pcli_flags &= ~PCLI_F_BIDIR; s->flags &= ~(SF_DIRECT|SF_ASSIGNED|SF_BE_ASSIGNED|SF_FORCE_PRST|SF_IGNORE_PRST); - s->flags &= ~(SF_CURR_SESS|SF_REDIRECTABLE|SF_SRV_REUSED); + s->flags &= ~(SF_REDIRECTABLE|SF_SRV_REUSED); s->flags &= ~(SF_ERR_MASK|SF_FINST_MASK|SF_REDISP); s->conn_retries = 0; /* used for logging too */ s->conn_exp = TICK_ETERNITY; diff --git a/src/http_ana.c b/src/http_ana.c index b8bba27d9..64ffbf85e 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -1191,9 +1191,6 @@ static __inline int do_l7_retry(struct stream *s, struct stconn *sc) return -1; s->conn_retries++; if (objt_server(s->target)) { - if (s->flags & SF_CURR_SESS) - s->flags &= ~SF_CURR_SESS; - if (s->sv_tgcounters) _HA_ATOMIC_INC(&s->sv_tgcounters->retries); } diff --git a/src/stream.c b/src/stream.c index 45877d7d8..5938bd274 100644 --- a/src/stream.c +++ b/src/stream.c @@ -630,9 +630,6 @@ void stream_free(struct stream *s) pendconn_free(s); if (objt_server(s->target)) { /* there may be requests left pending in queue */ - if (s->flags & SF_CURR_SESS) - s->flags &= ~SF_CURR_SESS; - if (may_dequeue_tasks(__objt_server(s->target), s->be)) process_srv_queue(__objt_server(s->target)); } @@ -2056,9 +2053,6 @@ struct task *process_stream(struct task *t, void *context, unsigned int state) scb->state = SC_ST_CLO; srv = objt_server(s->target); if (srv) { - if (s->flags & SF_CURR_SESS) - s->flags &= ~SF_CURR_SESS; - /* * We don't want to release the slot just yet * if we're using strict-maxconn, we want to @@ -2980,9 +2974,6 @@ void stream_shutdown_self(struct stream *stream, int why) stream->flags |= why; if (objt_server(stream->target)) { - if (stream->flags & SF_CURR_SESS) - stream->flags &= ~SF_CURR_SESS; - sess_change_server(stream, NULL); if (may_dequeue_tasks(objt_server(stream->target), stream->be)) process_srv_queue(objt_server(stream->target));