MEDIUM: tools: make str2sa_range() check that the protocol has ->connect()
authorWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 17:17:08 +0000 (19:17 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:08:08 +0000 (22:08 +0200)
commit65ec4e3ff7e9b5b1ce9a52a0e2d8c732f071460a
tree60351fae2aabd76b2baed5b73b637b6b54d1ca96
parent5fc9328aa2f42e4015090dae71bc2130840ce169
MEDIUM: tools: make str2sa_range() check that the protocol has ->connect()

Most callers of str2sa_range() need the protocol only to check that it
provides a ->connect() method. It used to be used to verify that it's a
stream protocol, but it might be a bit early to get rid of it. Let's keep
the test for now but move it to str2sa_range() when the new flag PA_O_CONNECT
is present. This way almost all call places could be cleaned from this.

There's a strange test in the server address parsing code that rechecks
the family from the socket which seems to be a duplicate of the previously
removed tests. It will have to be rechecked.
include/haproxy/tools-t.h
src/cfgparse-listen.c
src/cfgparse.c
src/check.c
src/server.c
src/tcpcheck.c
src/tools.c