BUG/MINOR: tcp-check: don't initialize then break a connection starting with a comment
authorWilly Tarreau <w@1wt.eu>
Wed, 4 Oct 2017 13:58:52 +0000 (15:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 4 Oct 2017 14:13:57 +0000 (16:13 +0200)
commit894c642fbf33e635fdd9422ca0e640dc61202342
treeac21324937c5368de840ccecd139f35c9913cb08
parent59070784fcac855b1a7e6da7c239800aeed622bb
BUG/MINOR: tcp-check: don't initialize then break a connection starting with a comment

The following config :

    backend tcp9000
        option tcp-check
        tcp-check comment "this is a comment"
        tcp-check connect port 10000
        server srv 127.0.0.1:9000 check inter 1s

will result in a connection being first made to port 9000 then immediately
destroyed and re-created on port 10000, because the first rule is a comment
and doesn't match the test for the first rule being a connect(). It's
mostly harmless (unless the server really must not receive empty
connections) and the workaround simply consists in removing the comment.

Let's proceed like in other places where we simply skip leading comments.
A new function was made to make this lookup les boring. The fix should be
backported to 1.7 and 1.6.
src/checks.c