From: Cyril Bonté Date: Mon, 12 Mar 2018 21:02:59 +0000 (+0100) Subject: BUG/MINOR: force-persist and ignore-persist only apply to backends X-Git-Tag: v1.9-dev1~376 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4288c5a9d81f89f65c02574a434b02e98eea943c;p=thirdparty%2Fhaproxy.git BUG/MINOR: force-persist and ignore-persist only apply to backends >From the very first day of force-persist and ignore-persist features, they only applied to backends, except that the documentation stated it could also be applied to frontends. In order to make it clear, the documentation is updated and the parser will raise a warning if the keywords are used in a frontend section. This patch should be backported up to the 1.5 branch. --- diff --git a/doc/configuration.txt b/doc/configuration.txt index a914c416cb..992e18acc7 100644 --- a/doc/configuration.txt +++ b/doc/configuration.txt @@ -2039,7 +2039,7 @@ errorloc X X X X errorloc302 X X X X -- keyword -------------------------- defaults - frontend - listen -- backend - errorloc303 X X X X -force-persist - X X X +force-persist - - X X filter - X X X fullconn X - X X grace X X X X @@ -2052,7 +2052,7 @@ http-response - X X X http-reuse X - X X http-send-name-header - - X X id - X X X -ignore-persist - X X X +ignore-persist - - X X load-server-state-from-file X - X X log (*) X X X X log-format X X X - @@ -3503,7 +3503,7 @@ email-alert to force-persist { if | unless } Declare a condition to force persistence on down servers May be used in sections: defaults | frontend | listen | backend - no | yes | yes | yes + no | no | yes | yes By default, requests are not dispatched to down servers. It is possible to force this using "option persist", but it is unconditional and redispatches @@ -4825,7 +4825,7 @@ id ignore-persist { if | unless } Declare a condition to ignore persistence May be used in sections: defaults | frontend | listen | backend - no | yes | yes | yes + no | no | yes | yes By default, when cookie persistence is enabled, every requests containing the cookie are unconditionally persistent (assuming the target server is up diff --git a/src/cfgparse.c b/src/cfgparse.c index 27d7eee7b4..c40e71dc79 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -4068,7 +4068,7 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm) goto out; } - if (warnifnotcap(curproxy, PR_CAP_FE|PR_CAP_BE, file, linenum, args[0], NULL)) + if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL)) err_code |= ERR_WARN; if (strcmp(args[1], "if") != 0 && strcmp(args[1], "unless") != 0) {