packages/net/haproxy/patches/006-BUG-MINOR-backend-balance-uri-specific-options-were-lost-across-defaults.patch
Christian Lachner 512411108c haproxy: Update all patches for HAProxy v1.8.17
- Add new patches (see https://www.haproxy.org/bugs/bugs-1.8.17.html)
- Raise PKG_RELEASE to 2
- Prefix patches with 3-digit numbers instead of 4-digit numbers

Signed-off-by: Christian Lachner <gladiac@gmail.com>
2019-01-31 13:59:35 +01:00

49 lines
2 KiB
Diff

commit a5027f804144536f79829443b33e6c19c32b690a
Author: Willy Tarreau <w@1wt.eu>
Date: Mon Jan 14 16:29:52 2019 +0100
BUG/MINOR: backend: balance uri specific options were lost across defaults
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.
(cherry picked from commit 602a499da5e81d6b4cfe8410f0fc6d53c1e06745)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit f00758fde5961e3bebc508852faeee4d9d80b0e0)
[wla: cfg_parse_listen() is still in cfgparse.c in 1.8]
Signed-off-by: William Lallemand <wlallemand@haproxy.org>
diff --git a/src/backend.c b/src/backend.c
index 87327f19..4c4044a6 100644
--- a/src/backend.c
+++ b/src/backend.c
@@ -1516,6 +1516,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")) {
diff --git a/src/cfgparse.c b/src/cfgparse.c
index 94f29637..91bb802e 100644
--- a/src/cfgparse.c
+++ b/src/cfgparse.c
@@ -2844,7 +2844,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);