]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: server: generalize sni expr parsing
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Thu, 23 May 2024 08:59:20 +0000 (10:59 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Fri, 24 May 2024 12:36:31 +0000 (14:36 +0200)
commit91001422b466ac8205acde1f94b7a6c4df536c49
tree8a96ff067f51e4b48adb4d9d60c3732b86107a00
parentb9f67a46a2c2d66d367a70b8f01785096003b98e
MINOR: server: generalize sni expr parsing

Two functions exists for server sni sample expression parsing. This is
confusing so this commit aims at clarifying this.

Functions are renamed with the following identifiers. First function is
named parse_srv_expr() and can be used during parsing. Besides
expression parsing, it has ensure sample fetch validity in the context
of a server line.

Second function is renamed _parse_srv_expr() and is used internally by
parse_srv_expr(). It only implements sample parsing without extra
checks. It is already use for server instantiation derived from
server-template as checks were already performed. Also, it is now used
in http-client code as SNI is a fixed string.

Finally, both functions are generalized to remove any reference to SNI.
This will allow to reuse it to parse other server keywords which use an
expression. This will be the case for the future keyword pool-conn-name.
include/haproxy/server.h
src/http_client.c
src/server.c