haproxy/include/types/vars.h
Christopher Faulet ff2613ed7a MEDIUM: vars: Add a per-process scope for variables
Now it is possible to use variables attached to a process. The scope name is
'proc'. These variables are released only when HAProxy is stopped.

'tune.vars.proc-max-size' directive has been added to confiure the maximum
amount of memory used by "proc" variables. And because memory accounting is
hierachical for variables, memory for "proc" vars includes memory for "sess"
vars.
2016-11-09 22:57:00 +01:00

34 lines
592 B
C

#ifndef _TYPES_VARS_H
#define _TYPES_VARS_H
#include <common/mini-clist.h>
#include <types/sample.h>
enum vars_scope {
SCOPE_SESS = 0,
SCOPE_TXN,
SCOPE_REQ,
SCOPE_RES,
SCOPE_PROC,
};
struct vars {
struct list head;
enum vars_scope scope;
unsigned int size;
};
/* This struct describes a variable. */
struct var_desc {
const char *name; /* Contains the normalized variable name. */
enum vars_scope scope;
};
struct var {
struct list l; /* Used for chaining vars. */
const char *name; /* Contains the variable name. */
struct sample_data data; /* data storage. */
};
#endif