]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: session: remove the list of streams from struct session
authorWilly Tarreau <w@1wt.eu>
Sun, 8 Oct 2017 19:32:53 +0000 (21:32 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 8 Oct 2017 20:32:05 +0000 (22:32 +0200)
Commit bcb86ab ("MINOR: session: add a streams field to the session
struct") added this list of streams that is not needed anymore. Let's
get rid of it now.

include/types/session.h
include/types/stream.h
src/peers.c
src/session.c
src/stream.c

index 0757c70c8b39b037ade656faf67cc937a945459d..09f2e718a5767bf8f7ce31337a2e9f8d04305f33 100644 (file)
@@ -40,7 +40,6 @@
 struct session {
        struct proxy *fe;               /* the proxy this session depends on for the client side */
        struct listener *listener;      /* the listener by which the request arrived */
-       struct list streams;            /* list of streams attached to this session */
        enum obj_type *origin;          /* the connection / applet which initiated this session */
        struct timeval accept_date;     /* date of the session's accept() in user date */
        struct timeval tv_accept;       /* date of the session's accept() in internal date (monotonic) */
index bc18f2c593b63ecd1719c70688eca1886904147b..227b0ffbab705f5edc4f2ebaa0b557509d775a2b 100644 (file)
@@ -133,7 +133,6 @@ struct stream {
                                         * This is a bit field of TASK_WOKEN_* */
 
        struct list list;               /* position in global streams list */
-       struct list by_sess;            /* position in the session's streams list */
        struct list by_srv;             /* position in server stream list */
        struct list back_refs;          /* list of users tracking this stream */
        struct buffer_wait buffer_wait; /* position in the list of objects waiting for a buffer */
index f63589d383ac72767aa1fa7f2bfe4d7662d7a748..21a556bcdb68fe49cb8e8e3482c8d21da14091a2 100644 (file)
@@ -1841,7 +1841,6 @@ static struct appctx *peer_session_create(struct peers *peers, struct peer *peer
 
        /* Error unrolling */
  out_free_strm:
-       LIST_DEL(&s->by_sess);
        LIST_DEL(&s->list);
        pool_free2(pool2_stream, s);
  out_free_sess:
index 08c3c6298c1acea24acb1fb44532efb4d6d0721e..79318b7d18954d2a6494a53f77519a46de68e8b7 100644 (file)
@@ -46,7 +46,6 @@ struct session *session_new(struct proxy *fe, struct listener *li, enum obj_type
        if (sess) {
                sess->listener = li;
                sess->fe = fe;
-               LIST_INIT(&sess->streams);
                sess->origin = origin;
                sess->accept_date = date; /* user-visible date for logging */
                sess->tv_accept   = now;  /* corrected date for internal use */
@@ -66,8 +65,6 @@ struct session *session_new(struct proxy *fe, struct listener *li, enum obj_type
 
 void session_free(struct session *sess)
 {
-       if (!LIST_ISEMPTY(&sess->streams))
-               return;
        sess->fe->feconn--;
        session_store_counters(sess);
        vars_prune_per_sess(&sess->vars);
index d497cdfe4608341a4d59f3224fe5f1d30775b072..8c8084c5a5a91e30126b6eb9ecc1ee58f76a9bc7 100644 (file)
@@ -154,7 +154,6 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin)
 
        /* OK, we're keeping the stream, so let's properly initialize the stream */
        LIST_ADDQ(&streams, &s->list);
-       LIST_ADDQ(&sess->streams, &s->by_sess);
        LIST_INIT(&s->back_refs);
 
        LIST_INIT(&s->buffer_wait.list);
@@ -276,7 +275,6 @@ struct stream *stream_new(struct session *sess, enum obj_type *origin)
        flt_stream_release(s, 0);
        task_free(t);
  out_fail_alloc:
-       LIST_DEL(&s->by_sess);
        LIST_DEL(&s->list);
        pool_free2(pool2_stream, s);
        return NULL;
@@ -376,7 +374,6 @@ static void stream_free(struct stream *s)
                        LIST_ADDQ(&LIST_ELEM(s->list.n, struct stream *, list)->back_refs, &bref->users);
                bref->ref = s->list.n;
        }
-       LIST_DEL(&s->by_sess);
        LIST_DEL(&s->list);
        si_release_endpoint(&s->si[1]);
        si_release_endpoint(&s->si[0]);