]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: tools: make str2sa_range() directly return the protocol
authorWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 16:25:03 +0000 (18:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Sep 2020 20:08:08 +0000 (22:08 +0200)
commit5fc9328aa2f42e4015090dae71bc2130840ce169
tree82cbcded8b0608fbde14b6284a8d5983eb40fff1
parent9b3178df23b688933e70d0be8e36f519fd248b3e
MINOR: tools: make str2sa_range() directly return the protocol

We'll need this so that it can return pointers to stacked protocol in
the future (for QUIC). In addition this removes a lot of tests for
protocol validity in the callers.

Some of them were checked further apart, or after a call to
str2listener() and they were simplified as well.

There's still a trick, we can fail to return a protocol in case the caller
accepts an fqdn for use later. This is what servers do and in this case it
is valid to return no protocol. A typical example is:

   server foo localhost:1111
include/haproxy/tools.h
src/cfgparse-listen.c
src/cfgparse.c
src/check.c
src/cli.c
src/hlua.c
src/log.c
src/server.c
src/tcpcheck.c
src/tools.c