]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: backend: balance uri specific options were lost across defaults
authorWilly Tarreau <w@1wt.eu>
Mon, 14 Jan 2019 15:29:52 +0000 (16:29 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 14 Jan 2019 18:33:17 +0000 (19:33 +0100)
The "balance uri" options "whole", "len" and "depth" were not properly
inherited from the defaults sections. In addition, "whole" and "len"
were not even reset when parsing "uri", meaning that 2 subsequent
"balance uri" statements would not have the expected effect as the
options from the first one would remain for the second one.

This may be backported to all maintained versions.

src/backend.c
src/cfgparse-listen.c

index 3c0ea8b4e8c4ad5ab6d75434dbdd3da8e3096849..00537f094bcf14895106696e86c7e61973b8f2a0 100644 (file)
@@ -1734,6 +1734,8 @@ int backend_parse_balance(const char **args, char **err, struct proxy *curproxy)
                curproxy->lbprm.algo |= BE_LB_ALGO_UH;
 
                curproxy->uri_whole = 0;
+               curproxy->uri_len_limit = 0;
+               curproxy->uri_dirs_depth1 = 0;
 
                while (*args[arg]) {
                        if (!strcmp(args[arg], "len")) {
index aa2d8608f4181f7673deef27a4dba9c2cf7a6fdb..8d2c176a894817652081d190f2febc2c5d0607fe 100644 (file)
@@ -469,7 +469,10 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
 
                        if (defproxy.url_param_name)
                                curproxy->url_param_name = strdup(defproxy.url_param_name);
-                       curproxy->url_param_len = defproxy.url_param_len;
+                       curproxy->url_param_len   = defproxy.url_param_len;
+                       curproxy->uri_whole       = defproxy.uri_whole;
+                       curproxy->uri_len_limit   = defproxy.uri_len_limit;
+                       curproxy->uri_dirs_depth1 = defproxy.uri_dirs_depth1;
 
                        if (defproxy.hh_name)
                                curproxy->hh_name = strdup(defproxy.hh_name);