mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-08 08:07:10 +02:00
MINOR: proxy/checks: Move parsing of external-check option in checks.c
Parsing of the proxy directive "option external-check" have been moved in checks.c.
This commit is contained in:
parent
51b129fd0f
commit
6f5579160a
@ -87,6 +87,8 @@ int proxy_parse_spop_check_opt(char **args, int cur_arg, struct proxy *curpx, st
|
||||
const char *file, int line);
|
||||
int proxy_parse_httpchk_opt(char **args, int cur_arg, struct proxy *curpx, struct proxy *defpx,
|
||||
const char *file, int line);
|
||||
int proxy_parse_external_check_opt(char **args, int cur_arg, struct proxy *curpx, struct proxy *defpx,
|
||||
const char *file, int line);
|
||||
|
||||
int set_srv_agent_send(struct server *srv, const char *send);
|
||||
|
||||
|
@ -2375,12 +2375,8 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
|
||||
goto out;
|
||||
}
|
||||
else if (!strcmp(args[1], "external-check")) {
|
||||
/* excute an external command to check servers' health */
|
||||
free(curproxy->check_req);
|
||||
curproxy->check_req = NULL;
|
||||
curproxy->options2 &= ~PR_O2_CHK_ANY;
|
||||
curproxy->options2 |= PR_O2_EXT_CHK;
|
||||
if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
|
||||
err_code |= proxy_parse_external_check_opt(args, 0, curproxy, &defproxy, file, linenum);
|
||||
if (err_code & ERR_FATAL)
|
||||
goto out;
|
||||
}
|
||||
else if (!strcmp(args[1], "forwardfor")) {
|
||||
|
16
src/checks.c
16
src/checks.c
@ -6339,6 +6339,22 @@ int proxy_parse_httpchk_opt(char **args, int cur_arg, struct proxy *curpx, struc
|
||||
goto out;
|
||||
}
|
||||
|
||||
int proxy_parse_external_check_opt(char **args, int cur_arg, struct proxy *curpx, struct proxy *defpx,
|
||||
const char *file, int line)
|
||||
{
|
||||
int err_code = 0;
|
||||
|
||||
free(curpx->check_req);
|
||||
curpx->check_req = NULL;
|
||||
curpx->options2 &= ~PR_O2_CHK_ANY;
|
||||
curpx->options2 |= PR_O2_EXT_CHK;
|
||||
if (alertif_too_many_args_idx(0, 1, file, line, args, &err_code))
|
||||
goto out;
|
||||
|
||||
out:
|
||||
return err_code;
|
||||
}
|
||||
|
||||
/* Parse the "addr" server keyword */
|
||||
static int srv_parse_addr(char **args, int *cur_arg, struct proxy *curpx, struct server *srv,
|
||||
char **errmsg)
|
||||
|
Loading…
Reference in New Issue
Block a user