mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-05-04 08:48:00 +00:00
MINOR: stick-table: allow to allocate an entry without filling it
By passing a NULL key to stksess_new(), we allocate it but do not yet fill it. That way the caller can do that.
This commit is contained in:
parent
72d6c16df4
commit
a7b46b50d9
@ -152,7 +152,8 @@ static int stktable_trash_oldest(struct stktable *t, int to_batch)
|
|||||||
* Allocate and initialise a new sticky session.
|
* Allocate and initialise a new sticky session.
|
||||||
* The new sticky session is returned or NULL in case of lack of memory.
|
* The new sticky session is returned or NULL in case of lack of memory.
|
||||||
* Sticky sessions should only be allocated this way, and must be freed using
|
* Sticky sessions should only be allocated this way, and must be freed using
|
||||||
* stksess_free(). Increase table <t> sticky session counter.
|
* stksess_free(). Table <t>'s sticky session counter is increased. If <key>
|
||||||
|
* is not NULL, it is assigned to the new session.
|
||||||
*/
|
*/
|
||||||
struct stksess *stksess_new(struct stktable *t, struct stktable_key *key)
|
struct stksess *stksess_new(struct stktable *t, struct stktable_key *key)
|
||||||
{
|
{
|
||||||
@ -170,6 +171,7 @@ struct stksess *stksess_new(struct stktable *t, struct stktable_key *key)
|
|||||||
if (ts) {
|
if (ts) {
|
||||||
t->current++;
|
t->current++;
|
||||||
stksess_init(t, ts);
|
stksess_init(t, ts);
|
||||||
|
if (key)
|
||||||
stksess_setkey(t, ts, key);
|
stksess_setkey(t, ts, key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user