MINOR: stick-table: Add prefixes to stick-table names.
With this patch we add a prefix to stick-table names declared in "peers" sections
concatenating the "peers" section name followed by a '/' character with
the stick-table name. Consequently, "peers" sections have their own
namespace for their stick-tables. Obviously, these stick-table names are not the
ones which should be sent over the network. So these configurations must be
compatible and should make A and B peers communicate with peers protocol:
# haproxy A config, old way stick-table declerations
peers mypeers
peer A ...
peer B ...
backend t1
stick-table type string size 10m store gpc0 peers mypeers
# haproxy B config, new way stick-table declerations
peers mypeers
peer A ...
peer B ...
table t1 type string size store gpc0 10m
This "network" name is stored in ->nid new field of stktable struct. The "local"
stktable-name is still stored in ->id.
diff --git a/include/proto/stick_table.h b/include/proto/stick_table.h
index 3010d81..a1dd06a 100644
--- a/include/proto/stick_table.h
+++ b/include/proto/stick_table.h
@@ -43,7 +43,7 @@
int stktable_init(struct stktable *t);
int stktable_parse_type(char **args, int *idx, unsigned long *type, size_t *key_size);
int parse_stick_table(const char *file, int linenum, char **args,
- struct stktable *t, char *id, struct peers *peers);
+ struct stktable *t, char *id, char *nid, struct peers *peers);
struct stksess *stktable_get_entry(struct stktable *table, struct stktable_key *key);
struct stksess *stktable_set_entry(struct stktable *table, struct stksess *nts);
void stktable_touch_with_exp(struct stktable *t, struct stksess *ts, int decrefcount, int expire);
diff --git a/include/types/stick_table.h b/include/types/stick_table.h
index a4baeb3..384a0a8 100644
--- a/include/types/stick_table.h
+++ b/include/types/stick_table.h
@@ -144,7 +144,8 @@
/* stick table */
struct stktable {
- char *id; /* table id name */
+ char *id; /* local table id name. */
+ char *nid; /* table id name sent over the network with peers protocol. */
struct stktable *next; /* The stick-table may be linked when belonging to
* the same configuration section.
*/