willy tarreau | 598da41 | 2005-12-18 01:07:29 +0100 | [diff] [blame] | 1 | #ifndef _APPSESS_H |
| 2 | #define _APPSESS_H |
| 3 | |
| 4 | #define TBLSIZ 10 |
| 5 | #define TBLCHKINT 5000 /* The time between two calls of appsession_refresh in ms */ |
| 6 | |
| 7 | /* |
| 8 | These Parts are copied from |
| 9 | |
| 10 | http://www.oreilly.com/catalog/masteralgoc/index.html |
| 11 | Mastering Algorithms with C |
| 12 | By Kyle Loudon |
| 13 | ISBN: 1-56592-453-3 |
| 14 | Publishd by O'Reilly |
| 15 | |
| 16 | We have added our own struct to these function. |
| 17 | */ |
| 18 | |
| 19 | #include <include/list.h> |
| 20 | #include <include/chtbl.h> |
| 21 | #include <include/hashpjw.h> |
| 22 | /* end of copied parts */ |
| 23 | |
| 24 | struct app_pool { |
| 25 | void **sessid; |
| 26 | void **serverid; |
| 27 | int ses_waste, ses_use, ses_msize; |
| 28 | int ser_waste, ser_use, ser_msize; |
| 29 | }; |
| 30 | |
| 31 | struct app_pool apools; |
| 32 | int have_appsession; |
| 33 | |
| 34 | /* Callback for hash_lookup */ |
| 35 | int match_str(const void *key1, const void *key2); |
| 36 | |
| 37 | /* Callback for destroy */ |
| 38 | void destroy(void *data); |
| 39 | |
| 40 | #if defined(DEBUG_HASH) |
| 41 | static void print_table(const CHTbl *htbl); |
| 42 | #endif |
| 43 | |
| 44 | #endif |