]> git.kaiwu.me - haproxy.git/commitdiff
MINOR: streams: Remove SF_CURR_SESS
authorOlivier Houchard <ohouchard@haproxy.com>
Tue, 3 Feb 2026 06:21:38 +0000 (07:21 +0100)
committerOlivier Houchard <cognet@ci0.org>
Mon, 2 Mar 2026 12:46:17 +0000 (13:46 +0100)
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
src/backend.c
src/cli.c
src/http_ana.c
src/stream.c

index b4677cb2f374235bacd2dc044277a884f971000e..a01048574b7813a949b21ead7e9c7d40ea727c08 100644 (file)
@@ -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);
index 3ed03dd414adbde6d60b3e002a8e6476a81a9665..4b485b46d0f85da91364aa02e9f9dfe7afb2eb8c 100644 (file)
@@ -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
index 8fac95e4e4b0bf45261f1a0394855241c3b5bee5..75c35912e24ee444f5253e0528cffe62b964b5c0 100644 (file)
--- 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;
index b8bba27d916d4c5fd733854970292f618df29164..64ffbf85e442344f29594be7883691475cfb2055 100644 (file)
@@ -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);
        }
index 45877d7d84207301dc93b1c446d36fea6ab69f43..5938bd27416b80190004df8a27e99872b022e32e 100644 (file)
@@ -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));