21200bf4fb3fb78512e1a51808ebf703275edfd8
[openwrt-packages.git] /
1 commit 54824cf35520b11ff97e0937beeb429dcdc55fd0
2 Author: Christopher Faulet <cfaulet@haproxy.com>
3 Date:   Mon Nov 12 11:57:31 2018 +0100
4
5     BUG/MINOR: config: Copy default error messages when parsing of a backend starts
6     
7     To be used, error messages declared in a default section must be copied when the
8     parsing of a proxy section starts. But this was only done for frontends.
9     
10     This patch may be backported to older versions.
11     
12     (cherry picked from commit 6b44975fbd2f7d81074e20bc07fc0e01466cc9c9)
13     Signed-off-by: William Lallemand <wlallemand@haproxy.org>
14
15 diff --git a/src/cfgparse.c b/src/cfgparse.c
16 index 618ffd39..6bc6b259 100644
17 --- a/src/cfgparse.c
18 +++ b/src/cfgparse.c
19 @@ -2787,15 +2787,15 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
20                         curproxy->server_id_hdr_name = strdup(defproxy.server_id_hdr_name);
21                 }
22  
23 +               /* initialize error relocations */
24 +               for (rc = 0; rc < HTTP_ERR_SIZE; rc++)
25 +                       chunk_dup(&curproxy->errmsg[rc], &defproxy.errmsg[rc]);
26 +
27                 if (curproxy->cap & PR_CAP_FE) {
28                         curproxy->maxconn = defproxy.maxconn;
29                         curproxy->backlog = defproxy.backlog;
30                         curproxy->fe_sps_lim = defproxy.fe_sps_lim;
31  
32 -                       /* initialize error relocations */
33 -                       for (rc = 0; rc < HTTP_ERR_SIZE; rc++)
34 -                               chunk_dup(&curproxy->errmsg[rc], &defproxy.errmsg[rc]);
35 -
36                         curproxy->to_log = defproxy.to_log & ~LW_COOKIE & ~LW_REQHDR & ~ LW_RSPHDR;
37                 }
38  
git clone https://git.99rst.org/PROJECT