From d6cc532ca1c27dc92edd7cfb626da8e3d1ec0106 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 4 Mar 2011 17:30:54 +0100 Subject: [PATCH] [MINOR] cfgparse: only keep one of dispatch, transparent, http_proxy Since all of them are defined as proxy options, it's better to ensure that at most one of them is enabled at once. The priority has been set according to what is already performed in the backend : 1) dispatch 2) http_proxy 3) transparent --- src/cfgparse.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cfgparse.c b/src/cfgparse.c index 8c23f9460..18cfda39d 100644 --- a/src/cfgparse.c +++ b/src/cfgparse.c @@ -5636,6 +5636,19 @@ int check_config_validity() } } + if (curproxy->options2 & PR_O2_DISPATCH) { + curproxy->options &= ~PR_O_TRANSP; + curproxy->options &= ~PR_O_HTTP_PROXY; + } + else if (curproxy->options & PR_O_HTTP_PROXY) { + curproxy->options2 &= ~PR_O2_DISPATCH; + curproxy->options &= ~PR_O_TRANSP; + } + else if (curproxy->options & PR_O_TRANSP) { + curproxy->options2 &= ~PR_O2_DISPATCH; + curproxy->options &= ~PR_O_HTTP_PROXY; + } + if ((curproxy->options & PR_O_DISABLE404) && !(curproxy->options & PR_O_HTTP_CHK)) { curproxy->options &= ~PR_O_DISABLE404; Warning("config : '%s' will be ignored for %s '%s' (requires 'option httpchk').\n",