summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWilly Tarreau <w@1wt.eu>2009-11-09 21:27:51 +0100
committerWilly Tarreau <w@1wt.eu>2009-11-09 21:27:51 +0100
commit5f0bd6537f8b56b643ef485d7a3c96d996d9b01a (patch)
treed1f642e314e056d9e2987ff471e4a96962c23520 /src
parent3b39c1446b9bd842324e87782a836948a07c25a2 (diff)
downloadhaproxy-5f0bd6537f8b56b643ef485d7a3c96d996d9b01a.tar.gz
[BUG] config: disable 'option httplog' on TCP proxies
Gabriel Sosa reported that logs were appearing with BADREQ when 'option httplog' was used with a TCP proxy (eg: inherited via a default instance). This patch detects it and falls back to tcplog after emitting a warning.
Diffstat (limited to 'src')
-rw-r--r--src/proxy.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/proxy.c b/src/proxy.c
index 69b070e2b..15f9b92d9 100644
--- a/src/proxy.c
+++ b/src/proxy.c
@@ -327,6 +327,11 @@ int proxy_cfg_ensure_no_http(struct proxy *curproxy)
Warning("config : Layer 7 hash not possible for %s '%s' (needs 'mode http'). Falling back to round robin.\n",
proxy_type_str(curproxy), curproxy->id);
}
+ if (curproxy->to_log & (LW_REQ | LW_RESP)) {
+ curproxy->to_log &= ~(LW_REQ | LW_RESP);
+ Warning("config : 'option httplog' not usable with %s '%s' (needs 'mode http'). Falling back to 'option tcplog'.\n",
+ proxy_type_str(curproxy), curproxy->id);
+ }
return 0;
}