From: Willy Tarreau Date: Fri, 4 Mar 2011 16:30:54 +0000 (+0100) Subject: [MINOR] cfgparse: only keep one of dispatch, transparent, http_proxy X-Git-Tag: v1.5-dev8~288 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d6cc532ca1c27dc92edd7cfb626da8e3d1ec0106;p=thirdparty%2Fhaproxy.git [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 --- diff --git a/src/cfgparse.c b/src/cfgparse.c index 8c23f94609..18cfda39db 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",