]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: server: irrelevant error message with 'default-server' config file keyword.
authorFrédéric Lécaille <flecaille@haproxy.com>
Thu, 9 Mar 2017 13:01:02 +0000 (14:01 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 27 Mar 2017 12:33:58 +0000 (14:33 +0200)
There is no reason to emit such an error message:
"'default-server' expects <name> and <addr>[:<port>] as arguments."
if less than two arguments are provided on 'default-server' lines.
This is a 'server' specific error message.

src/server.c

index 5589723efb26c2655b5ab467900bf499c6f51fea..563d38dbefa3cee1b62a8a7a6f1ff11bea7cb0e1 100644 (file)
@@ -1020,7 +1020,7 @@ int parse_server(const char *file, int linenum, char **args, struct proxy *curpr
                else if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[0], NULL))
                        err_code |= ERR_ALERT | ERR_FATAL;
 
-               if (!*args[2]) {
+               if (!defsrv && !*args[2]) {
                        Alert("parsing [%s:%d] : '%s' expects <name> and <addr>[:<port>] as arguments.\n",
                              file, linenum, args[0]);
                        err_code |= ERR_ALERT | ERR_FATAL;