MINOR: stream: link the stream to its session
Now each stream is added to the session's list of streams, so that it
will be possible to know all the streams belonging to a session, and
to know if any stream is still attached to a sessoin.
diff --git a/src/stream.c b/src/stream.c
index 3a88fd4..4319667 100644
--- a/src/stream.c
+++ b/src/stream.c
@@ -135,6 +135,7 @@
/* 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);
@@ -249,6 +250,7 @@
/* Error unrolling */
out_fail_accept:
flt_stream_release(s, 0);
+ LIST_DEL(&s->by_sess);
LIST_DEL(&s->list);
pool_free2(pool2_stream, s);
return NULL;
@@ -348,6 +350,7 @@
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]);