]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
[BUG] config: disable 'option httplog' on TCP proxies
authorWilly Tarreau <w@1wt.eu>
Mon, 9 Nov 2009 20:27:51 +0000 (21:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Sun, 6 Dec 2009 12:24:11 +0000 (13:24 +0100)
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.
(cherry picked from commit 5f0bd6537f8b56b643ef485d7a3c96d996d9b01a)

src/proxy.c

index 181cdd8bdc2fb0bd5992133e282f4fcfcf1370b1..38eb2be899db764c5f1fa5a66874dd8e9b785d8a 100644 (file)
@@ -391,6 +391,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;
 }