mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-09-22 14:21:25 +02:00
MINOR: checks: Add the default option for tcp-check connect rules
With this option, it is possible to open a connection from a tcp-check connect rule using all parameter of the server line, like any other healthcheck. For now, this parameter is exclusive with all other option for a tcp-check connect rule.
This commit is contained in:
parent
d75f57e94c
commit
4dce5923c8
@ -9818,6 +9818,9 @@ tcp-check connect [params*]
|
|||||||
They are optional and can be used to describe how HAProxy should open and
|
They are optional and can be used to describe how HAProxy should open and
|
||||||
use the TCP connection.
|
use the TCP connection.
|
||||||
|
|
||||||
|
default Use default options of the server line to do the health
|
||||||
|
checks. This parameter is exclusive with all other options.
|
||||||
|
|
||||||
port if not set, check port or server port is used.
|
port if not set, check port or server port is used.
|
||||||
It tells HAProxy where to open the connection to.
|
It tells HAProxy where to open the connection to.
|
||||||
<port> must be a valid TCP port source integer, from 1 to 65535.
|
<port> must be a valid TCP port source integer, from 1 to 65535.
|
||||||
|
11
src/checks.c
11
src/checks.c
@ -4099,7 +4099,14 @@ static struct tcpcheck_rule *parse_tcpcheck_connect(char **args, int cur_arg, st
|
|||||||
|
|
||||||
cur_arg++;
|
cur_arg++;
|
||||||
while (*(args[cur_arg])) {
|
while (*(args[cur_arg])) {
|
||||||
if (strcmp(args[cur_arg], "port") == 0) {
|
if (strcmp(args[cur_arg], "default") == 0) {
|
||||||
|
if (cur_arg != 2 || *(args[cur_arg+1])) {
|
||||||
|
memprintf(errmsg, "'%s' is exclusive with all other options", args[cur_arg]);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
conn_opts = TCPCHK_OPT_DEFAULT_CONNECT;
|
||||||
|
}
|
||||||
|
else if (strcmp(args[cur_arg], "port") == 0) {
|
||||||
if (!*(args[cur_arg+1])) {
|
if (!*(args[cur_arg+1])) {
|
||||||
memprintf(errmsg, "'%s' expects a port number as argument.", args[cur_arg]);
|
memprintf(errmsg, "'%s' expects a port number as argument.", args[cur_arg]);
|
||||||
goto error;
|
goto error;
|
||||||
@ -4168,7 +4175,7 @@ static struct tcpcheck_rule *parse_tcpcheck_connect(char **args, int cur_arg, st
|
|||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
", 'ssl', 'sni', 'alpn'"
|
", 'ssl', 'sni', 'alpn'"
|
||||||
#endif /* USE_OPENSSL */
|
#endif /* USE_OPENSSL */
|
||||||
" or 'via-socks4', 'linger' but got '%s' as argument.",
|
" or 'via-socks4', 'linger', 'default' but got '%s' as argument.",
|
||||||
args[cur_arg]);
|
args[cur_arg]);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user