blob: caf8c1439f5f9f1e2066d541ade76a87cf0af1a4 [file] [log] [blame]
Willy Tarreaub1ec8c42015-04-03 13:53:24 +02001/*
2 * Stream management functions.
3 *
4 * Copyright 2000-2012 Willy Tarreau <w@1wt.eu>
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version
9 * 2 of the License, or (at your option) any later version.
10 *
11 */
12
13#include <common/config.h>
14#include <common/buffer.h>
15#include <common/debug.h>
16#include <common/memory.h>
17
18#include <types/global.h>
19#include <types/session.h>
20
Willy Tarreaubb2ef122015-04-04 16:31:16 +020021#include <proto/session.h>
22
Willy Tarreaub1ec8c42015-04-03 13:53:24 +020023struct pool_head *pool2_session;
24
Willy Tarreau11c36242015-04-04 15:54:03 +020025void session_free(struct session *sess)
26{
Willy Tarreaubb2ef122015-04-04 16:31:16 +020027 session_store_counters(sess);
Willy Tarreau11c36242015-04-04 15:54:03 +020028 pool_free2(pool2_session, sess);
29}
30
Willy Tarreaub1ec8c42015-04-03 13:53:24 +020031/* perform minimal intializations, report 0 in case of error, 1 if OK. */
32int init_session()
33{
34 pool2_session = create_pool("session", sizeof(struct session), MEM_F_SHARED);
35 return pool2_session != NULL;
36}
37
38/*
39 * Local variables:
40 * c-indent-level: 8
41 * c-basic-offset: 8
42 * End:
43 */