Willy Tarreau | b1ec8c4 | 2015-04-03 13:53:24 +0200 | [diff] [blame] | 1 | /* |
| 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 Tarreau | bb2ef12 | 2015-04-04 16:31:16 +0200 | [diff] [blame] | 21 | #include <proto/session.h> |
| 22 | |
Willy Tarreau | b1ec8c4 | 2015-04-03 13:53:24 +0200 | [diff] [blame] | 23 | struct pool_head *pool2_session; |
| 24 | |
Willy Tarreau | 11c3624 | 2015-04-04 15:54:03 +0200 | [diff] [blame] | 25 | void session_free(struct session *sess) |
| 26 | { |
Willy Tarreau | bb2ef12 | 2015-04-04 16:31:16 +0200 | [diff] [blame] | 27 | session_store_counters(sess); |
Willy Tarreau | 11c3624 | 2015-04-04 15:54:03 +0200 | [diff] [blame] | 28 | pool_free2(pool2_session, sess); |
| 29 | } |
| 30 | |
Willy Tarreau | b1ec8c4 | 2015-04-03 13:53:24 +0200 | [diff] [blame] | 31 | /* perform minimal intializations, report 0 in case of error, 1 if OK. */ |
| 32 | int 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 | */ |