From: Christopher Faulet Date: Mon, 12 Nov 2018 10:57:31 +0000 (+0100) Subject: BUG/MINOR: config: Copy default error messages when parsing of a backend starts X-Git-Tag: v1.9-dev7~109 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b44975fbd2f7d81074e20bc07fc0e01466cc9c9;p=thirdparty%2Fhaproxy.git BUG/MINOR: config: Copy default error messages when parsing of a backend starts To be used, error messages declared in a default section must be copied when the parsing of a proxy section starts. But this was only done for frontends. This patch may be backported to older versions. --- diff --git a/src/cfgparse.c b/src/cfgparse.c index cef5e3979c..ab330a9011 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -2834,15 +2834,15 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) curproxy->server_id_hdr_name = strdup(defproxy.server_id_hdr_name); } + /* initialize error relocations */ + for (rc = 0; rc < HTTP_ERR_SIZE; rc++) + chunk_dup(&curproxy->errmsg[rc], &defproxy.errmsg[rc]); + if (curproxy->cap & PR_CAP_FE) { curproxy->maxconn = defproxy.maxconn; curproxy->backlog = defproxy.backlog; curproxy->fe_sps_lim = defproxy.fe_sps_lim; - /* initialize error relocations */ - for (rc = 0; rc < HTTP_ERR_SIZE; rc++) - chunk_dup(&curproxy->errmsg[rc], &defproxy.errmsg[rc]); - curproxy->to_log = defproxy.to_log & ~LW_COOKIE & ~LW_REQHDR & ~ LW_RSPHDR; }