]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] cookie: correctly unset default cookie parameters
authorWilly Tarreau <w@1wt.eu>
Sat, 23 Oct 2010 09:37:27 +0000 (11:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 30 Oct 2010 17:04:36 +0000 (19:04 +0200)
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)

src/cfgparse.c

index 58c5db86563c84e2252ba29a812b448fe7e547a1..da6ef81a8cf5b5769eb277e8b12500a256167440 100644 (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")) {