#define STKCTR_TRACK_BACKEND 1
#define STKCTR_TRACK_CONTENT 2
+/* type of the sticky session in the updates tree */
+enum {
+ STKSESS_UPDT_NONE = 0, /* unset, only if table is not used by the peers */
+ STKSESS_UPDT_LOCAL, /* the sticky session is locally updated */
+ STKSESS_UPDT_REMOTE, /* the sticky session is remotely updated */
+ STKSESS_UPDT_MARKER, /* not a true sticky session, only used a marker*/
+};
+
+
/* stick_table extra data. This is mainly used for casting or size computation */
union stktable_data {
/* standard types for easy casting */
struct eb32_node exp; /* ebtree node used to hold the session in expiration tree */
struct eb32_node upd; /* ebtree node used to hold the update sequence tree */
struct mt_list pend_updts;/* list of entries to be inserted/moved in the update sequence tree */
- int updt_is_local; /* is the update a local one ? */
+ unsigned int updt_type; /* One of STKSESS_UPDT_* value */
struct ebmb_node key; /* ebtree node used to hold the session in table */
/* WARNING! do not put anything after <keys>, it's used by the key */
};
ts->key.node.leaf_p = NULL;
ts->exp.node.leaf_p = NULL;
ts->upd.node.leaf_p = NULL;
+ ts->updt_type = STKSESS_UPDT_NONE;
MT_LIST_INIT(&ts->pend_updts);
ts->expire = tick_add(now_ms, MS_TO_TICKS(t->expire));
HA_RWLOCK_INIT(&ts->lock);
* scheduled for at least one peer.
*/
if (!ts->upd.node.leaf_p || _HA_ATOMIC_LOAD(&ts->seen)) {
- _HA_ATOMIC_STORE(&ts->updt_is_local, 1);
+ _HA_ATOMIC_STORE(&ts->updt_type, STKSESS_UPDT_LOCAL);
did_append = MT_LIST_TRY_APPEND(&t->pend_updts[tgid - 1], &ts->pend_updts);
}
}
else {
if (!ts->upd.node.leaf_p) {
- _HA_ATOMIC_STORE(&ts->updt_is_local, 0);
+ _HA_ATOMIC_STORE(&ts->updt_type, STKSESS_UPDT_REMOTE);
did_append = MT_LIST_TRY_APPEND(&t->pend_updts[tgid - 1], &ts->pend_updts);
}
}
empty_tgid = 0;
if (cur_tgid == global.nbtgroups)
cur_tgid = 0;
- is_local = stksess->updt_is_local;
+ is_local = (stksess->updt_type == STKSESS_UPDT_LOCAL);
stksess->seen = 0;
if (is_local) {
stksess->upd.key = ++table->update;