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) */
* 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 */
/* Error unrolling */
out_free_strm:
- LIST_DEL(&s->by_sess);
LIST_DEL(&s->list);
pool_free2(pool2_stream, s);
out_free_sess:
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 */
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);
/* 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);
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;
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]);