mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-12 06:24:56 +00:00
26c250683f
All the tasks callbacks had to requeue the task themselves, and update a global timeout. This was not convenient at all. Now the API has been simplified. The tasks callbacks only have to update their expire timer, and return either a pointer to the task or NULL if the task has been deleted. The scheduler will take care of requeuing the task at the proper place in the wait queue.
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);
|
|
|
|
struct task *appsession_refresh(struct task *t);
|
|
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:
|
|
*/
|