[BUG] cookie: correctly unset default cookie parameters

When a backend defines a new cookie, it forgot to unset any params
that could have been set in a defaults section, resulting in configs
that would sometimes refuse to load or not work as expected.
(cherry picked from commit f80bf174ed905a29a3ed8ee91fcd528da6df174f)
This commit is contained in:
Willy Tarreau 2010-10-23 11:37:27 +02:00
parent bfcd31134b
commit c63d4bbff9

View File

@ -1660,11 +1660,13 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
goto out;
}
curproxy->options &= ~PR_O_COOK_ANY;
curproxy->cookie_maxidle = curproxy->cookie_maxlife = 0;
free(curproxy->cookie_domain); curproxy->cookie_domain = NULL;
free(curproxy->cookie_name);
curproxy->cookie_name = strdup(args[1]);
curproxy->cookie_len = strlen(curproxy->cookie_name);
cur_arg = 2;
while (*(args[cur_arg])) {
if (!strcmp(args[cur_arg], "rewrite")) {