From: Willy Tarreau Date: Sun, 8 Oct 2017 19:32:53 +0000 (+0200) Subject: MINOR: session: remove the list of streams from struct session X-Git-Tag: v1.8-dev3~45 X-Git-Url: http://git.haproxy.org/?a=commitdiff_plain;h=bf08beb2a349403c3b491831fc7e5d3d8d518566;p=haproxy-3.0.git MINOR: session: remove the list of streams from struct session 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. --- diff --git a/include/types/session.h b/include/types/session.h index 0757c70..09f2e71 100644 --- a/include/types/session.h +++ b/include/types/session.h @@ -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) */ diff --git a/include/types/stream.h b/include/types/stream.h index bc18f2c..227b0ff 100644 --- a/include/types/stream.h +++ b/include/types/stream.h @@ -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 */ diff --git a/src/peers.c b/src/peers.c index f63589d..21a556b 100644 --- a/src/peers.c +++ b/src/peers.c @@ -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: diff --git a/src/session.c b/src/session.c index 08c3c62..79318b7 100644 --- a/src/session.c +++ b/src/session.c @@ -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); diff --git a/src/stream.c b/src/stream.c index d497cdf..8c8084c 100644 --- a/src/stream.c +++ b/src/stream.c @@ -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]);