mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-15 07:54:33 +00:00
0c303eec87
This is the first attempt at moving all internal parts from using struct timeval to integer ticks. Those provides simpler and faster code due to simplified operations, and this change also saved about 64 bytes per session. A new header file has been added : include/common/ticks.h. It is possible that some functions should finally not be inlined because they're used quite a lot (eg: tick_first, tick_add_ifset and tick_is_expired). More measurements are required in order to decide whether this is interesting or not. Some function and variable names are still subject to change for a better overall logics.
54 lines
1.0 KiB
C
54 lines
1.0 KiB
C
#ifndef _COMMON_APPSESS_H
|
|
#define _COMMON_APPSESS_H
|
|
|
|
/*
|
|
* The time between two calls of appsession_refresh in ms.
|
|
*/
|
|
#define TBLCHKINT 5000
|
|
|
|
#include <sys/time.h>
|
|
|
|
#include <common/config.h>
|
|
#include <common/memory.h>
|
|
|
|
#include <types/task.h>
|
|
|
|
typedef struct appsessions {
|
|
char *sessid;
|
|
char *serverid;
|
|
int expire; /* next expiration time for this application session (in tick) */
|
|
unsigned long int request_count;
|
|
struct list hash_list;
|
|
} appsess;
|
|
|
|
extern struct pool_head *pool2_appsess;
|
|
|
|
struct app_pool {
|
|
struct pool_head *sessid;
|
|
struct pool_head *serverid;
|
|
};
|
|
|
|
extern struct app_pool apools;
|
|
extern int have_appsession;
|
|
|
|
|
|
/* Callback for hash_lookup */
|
|
int match_str(const void *key1, const void *key2);
|
|
|
|
/* Callback for destroy */
|
|
void destroy(appsess *data);
|
|
|
|
void appsession_refresh(struct task *t, int *next);
|
|
int appsession_task_init(void);
|
|
int appsession_init(void);
|
|
void appsession_cleanup(void);
|
|
|
|
#endif /* _COMMON_APPSESS_H */
|
|
|
|
/*
|
|
* Local variables:
|
|
* c-indent-level: 8
|
|
* c-basic-offset: 8
|
|
* End:
|
|
*/
|