]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: server: indicate when no address was expected for a server
authorWilly Tarreau <w@1wt.eu>
Tue, 31 May 2022 07:25:34 +0000 (09:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 31 May 2022 07:25:34 +0000 (09:25 +0200)
commit245721b329721e862f34cebf6cf355694df31cb0
tree705add75bafd3f486a152d323276e949aef04e92
parent356866accefd16458f0e3c335d1b784e24e86d2d
MINOR: server: indicate when no address was expected for a server

When parsing a peers section, it's particularly difficult to make the
difference between the local peer which doesn't have any address, and
other peers which need one, and the error messages do not help because
with just:

    peers foo
       bind :8001
       server foo 127.0.0.1:8001
       server bar 127.0.0.2:8001

One can get such a confusing message when the local peer is "bar":

  [peers.cfg:15] : 'server foo/bar' : unknown keyword '127.0.0.1:8001'.

It's not clear there why the other peer doesn't trigger an error.
With this commit we add a hint in the error message when no address
was expected. The error remains quite generic (since deep into the
server code) but at least the useer gets a hint about why the keyword
wasn't understood:

  [peers.cfg:15] : 'server foo/bar' : unknown keyword '127.0.0.1:8001'.
                   Hint: no address was expected for this server.
src/server.c