diff --git a/include/types/proxy.h b/include/types/proxy.h index 9e49bd8305..b1b90e887d 100644 --- a/include/types/proxy.h +++ b/include/types/proxy.h @@ -290,6 +290,10 @@ struct proxy { unsigned int backlog; /* force the frontend's listen backlog */ unsigned int bind_proc; /* bitmask of processes using this proxy. 0 = all. */ struct error_snapshot invalid_req, invalid_rep; /* captures of last errors */ + + /* used only during configuration parsing */ + int no_options; /* PR_O_REDISP, PR_O_TRANSP, ... */ + int no_options2; /* PR_O2_* */ }; struct switching_rule { diff --git a/src/cfgparse.c b/src/cfgparse.c index b268d598ae..2e079c71da 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -773,6 +773,8 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv) curproxy->state = defproxy.state; curproxy->options = defproxy.options; curproxy->options2 = defproxy.options2; + curproxy->no_options = defproxy.no_options; + curproxy->no_options2 = defproxy.no_options2; curproxy->bind_proc = defproxy.bind_proc; curproxy->lbprm.algo = defproxy.lbprm.algo; curproxy->except_net = defproxy.except_net; @@ -1594,10 +1596,13 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv) if (warnifnotcap(curproxy, cfg_opts[optnum].cap, file, linenum, args[1], NULL)) return 0; - if (!inv) - curproxy->options |= cfg_opts[optnum].val; - else - curproxy->options &= ~cfg_opts[optnum].val; + if (!inv) { + curproxy->no_options &= ~cfg_opts[optnum].val; + curproxy->options |= cfg_opts[optnum].val; + } else { + curproxy->options &= ~cfg_opts[optnum].val; + curproxy->no_options |= cfg_opts[optnum].val; + } return 0; } @@ -1608,11 +1613,13 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int inv) if (warnifnotcap(curproxy, cfg_opts2[optnum].cap, file, linenum, args[1], NULL)) return 0; - if (!inv) - curproxy->options2 |= cfg_opts2[optnum].val; - else - curproxy->options2 &= ~cfg_opts2[optnum].val; - + if (!inv) { + curproxy->no_options2 &= ~cfg_opts2[optnum].val; + curproxy->options2 |= cfg_opts2[optnum].val; + } else { + curproxy->options2 &= ~cfg_opts2[optnum].val; + curproxy->no_options2 |= cfg_opts2[optnum].val; + } return 0; } }