struct conn_src conn_src; /* connection source settings */
enum obj_type *default_target; /* default target to use for accepted streams or NULL */
struct proxy *next;
+ struct proxy *next_stkt_ref; /* Link to the list of proxies which refer to the same stick-table. */
struct list logsrvs;
struct list logformat; /* log_format linked list */
void *p;
} data_arg[STKTABLE_DATA_TYPES]; /* optional argument of each data type */
struct proxy *proxy; /* The proxy this stick-table is attached to, if any.*/
+ struct proxy *proxies_list; /* The list of proxies which reference this stick-table. */
};
extern struct stktable_data_type stktable_data_types[STKTABLE_DATA_TYPES];
return 0;
}
else {
+ if (target->proxies_list != px) {
+ px->next_stkt_ref = target->proxies_list;
+ target->proxies_list = px;
+ }
free(rule->arg.trk_ctr.table.n);
rule->arg.trk_ctr.table.t = target;
/* Note: if we decide to enhance the track-sc syntax, we may be
stktable_store_name(curproxy->table);
curproxy->table->next = stktables_list;
stktables_list = curproxy->table;
+
+ /* Add this proxy to the list of proxies which refer to its stick-table. */
+ if (curproxy->table->proxies_list != curproxy) {
+ curproxy->next_stkt_ref = curproxy->table->proxies_list;
+ curproxy->table->proxies_list = curproxy;
+ }
}
else if (!strcmp(args[0], "stick")) {
struct sticking_rule *rule;
if (curproxy->table && curproxy->table->peers.p)
curproxy->table->peers.p->peers_fe->bind_proc |= curproxy->bind_proc;
+ /* compute the required process bindings for the peers from <stktables_list>
+ * for all the stick-tables, the ones coming with "peers" sections included.
+ */
+ for (t = stktables_list; t; t = t->next) {
+ struct proxy *p;
+
+ for (p = t->proxies_list; p; p = p->next_stkt_ref) {
+ if (t->peers.p && t->peers.p->peers_fe) {
+ t->peers.p->peers_fe->bind_proc |= p->bind_proc;
+ }
+ }
+ }
+
if (cfg_peers) {
struct peers *curpeers = cfg_peers, **last;
struct peer *p, *pb;
break;
}
+ if (t->proxies_list != p) {
+ p->next_stkt_ref = t->proxies_list;
+ t->proxies_list = p;
+ }
+
free(arg->data.str.area);
arg->data.str.area = NULL;
arg->unresolved = 0;