]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: stream: rename a few remaining occurrences of "stream *sess"
authorWilly Tarreau <w@1wt.eu>
Tue, 9 Mar 2021 14:43:32 +0000 (15:43 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 9 Mar 2021 14:44:33 +0000 (15:44 +0100)
These are some leftovers from the ancient code where they were still
called sessions, but these areas in the code remain confusing due to
this naming. They were now called "strm" which will not even affect
indenting nor alignment.

include/haproxy/stream.h
src/stream.c

index f558a1fa4df63f2d5ef94ff65ade332b5582a298..bfd92ec0b453178f06b4fa034622facf86b0e527 100644 (file)
@@ -69,7 +69,7 @@ void stream_dump_and_crash(enum obj_type *obj, int rate);
 struct ist stream_generate_unique_id(struct stream *strm, struct list *format);
 
 void stream_process_counters(struct stream *s);
-void sess_change_server(struct stream *sess, struct server *newsrv);
+void sess_change_server(struct stream *strm, struct server *newsrv);
 struct task *process_stream(struct task *t, void *context, unsigned int state);
 void default_srv_error(struct stream *s, struct stream_interface *si);
 
@@ -280,7 +280,7 @@ static inline void stream_inc_http_fail_ctr(struct stream *s)
        }
 }
 
-static inline void stream_add_srv_conn(struct stream *sess, struct server *srv)
+static inline void stream_add_srv_conn(struct stream *strm, struct server *srv)
 {
        /* note: this inserts in reverse order but we do not care, it's only
         * used for massive kills (i.e. almost never). MT_LIST_ADD() is a bit
@@ -288,25 +288,25 @@ static inline void stream_add_srv_conn(struct stream *sess, struct server *srv)
         * from a conflict with an adjacent MT_LIST_DEL, and using it improves
         * the performance by about 3% on 32-cores.
         */
-       MT_LIST_ADD(&srv->per_thr[tid].streams, &sess->by_srv);
-       HA_ATOMIC_STORE(&sess->srv_conn, srv);
+       MT_LIST_ADD(&srv->per_thr[tid].streams, &strm->by_srv);
+       HA_ATOMIC_STORE(&strm->srv_conn, srv);
 }
 
-static inline void stream_del_srv_conn(struct stream *sess)
+static inline void stream_del_srv_conn(struct stream *strm)
 {
-       struct server *srv = sess->srv_conn;
+       struct server *srv = strm->srv_conn;
 
        if (!srv)
                return;
 
-       MT_LIST_DEL(&sess->by_srv);
-       HA_ATOMIC_STORE(&sess->srv_conn, NULL);
+       MT_LIST_DEL(&strm->by_srv);
+       HA_ATOMIC_STORE(&strm->srv_conn, NULL);
 }
 
-static inline void stream_init_srv_conn(struct stream *sess)
+static inline void stream_init_srv_conn(struct stream *strm)
 {
-       sess->srv_conn = NULL;
-       MT_LIST_INIT(&sess->by_srv);
+       strm->srv_conn = NULL;
+       MT_LIST_INIT(&strm->by_srv);
 }
 
 static inline void stream_choose_redispatch(struct stream *s)
index e96d89e014402d2fd4cce94c09b52129b45750a3..c27ea539c0f86389ac883fdc255b829f02b00816 100644 (file)
@@ -2532,9 +2532,9 @@ void stream_update_time_stats(struct stream *s)
  * expect to be informed about any change in the number of active streams on a
  * server.
  */
-void sess_change_server(struct stream *sess, struct server *newsrv)
+void sess_change_server(struct stream *strm, struct server *newsrv)
 {
-       struct server *oldsrv = sess->srv_conn;
+       struct server *oldsrv = strm->srv_conn;
 
        if (oldsrv == newsrv)
                return;
@@ -2545,7 +2545,7 @@ void sess_change_server(struct stream *sess, struct server *newsrv)
                __ha_barrier_atomic_store();
                if (oldsrv->proxy->lbprm.server_drop_conn)
                        oldsrv->proxy->lbprm.server_drop_conn(oldsrv, 0);
-               stream_del_srv_conn(sess);
+               stream_del_srv_conn(strm);
        }
 
        if (newsrv) {
@@ -2554,7 +2554,7 @@ void sess_change_server(struct stream *sess, struct server *newsrv)
                __ha_barrier_atomic_store();
                if (newsrv->proxy->lbprm.server_take_conn)
                        newsrv->proxy->lbprm.server_take_conn(newsrv, 0);
-               stream_add_srv_conn(sess, newsrv);
+               stream_add_srv_conn(strm, newsrv);
        }
 }