]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: bind: handle warning label on bind keywords parsing.
authorEmeric Brun <ebrun@haproxy.com>
Thu, 17 Oct 2019 14:45:56 +0000 (16:45 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 18 Oct 2019 13:18:52 +0000 (15:18 +0200)
All bind keyword parsing message were show as alerts.

With this patch if the message is flagged only with ERR_WARN and
not ERR_ALERT it will show a label [WARNING] and not [ALERT].

src/cfgparse-listen.c

index 6bece743d645e628c8224ed6f5e3e2e7682e7367..09b172724c5a655146290ef2dcd156f52e7e270e 100644 (file)
@@ -604,7 +604,10 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
                                if (code) {
                                        if (err && *err) {
                                                indent_msg(&err, 2);
-                                               ha_alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], err);
+                                               if (((code & (ERR_WARN|ERR_ALERT)) == ERR_WARN))
+                                                       ha_warning("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], err);
+                                               else
+                                                       ha_alert("parsing [%s:%d] : '%s %s' : %s\n", file, linenum, args[0], args[1], err);
                                        }
                                        else
                                                ha_alert("parsing [%s:%d] : '%s %s' : error encountered while processing '%s'.\n",