MEDIUM: check: remove checkport checkaddr flag
While trying to fix some consistency problem with the config file/cli (e.g. check-port cli command does not set the flag), we realised checkport flag was not necessarily needed. Indeed tcpcheck uses service port as the last choice if check.port is zero. So we can assume if check.port is zero, it means it was never set by the user, regardless if it is by the cli or config file. In the longterm this will avoid to introduce a new consistency issue if we forget to set the flag. in the same manner of checkport flag, we don't really need checkaddr flag. We can assume if checkaddr is not set, it means it was never set by the user or config. Signed-off-by: William Dauchy <wdauchy@gmail.com>
This commit is contained in:
parent
21ca3dfc3a
commit
69f118d7b6
@ -137,8 +137,6 @@ enum srv_initaddr {
|
||||
#define SRV_F_NON_STICK 0x0004 /* never add connections allocated to this server to a stick table */
|
||||
#define SRV_F_USE_NS_FROM_PP 0x0008 /* use namespace associated with connection if present */
|
||||
#define SRV_F_FORCED_ID 0x0010 /* server's ID was forced in the configuration */
|
||||
#define SRV_F_CHECKADDR 0x0020 /* this server has a check addr configured */
|
||||
#define SRV_F_CHECKPORT 0x0040 /* this server has a check port configured */
|
||||
#define SRV_F_AGENTADDR 0x0080 /* this server has a agent addr configured */
|
||||
#define SRV_F_COOKIESET 0x0100 /* this server has a cookie configured, so don't generate dynamic cookies */
|
||||
#define SRV_F_FASTOPEN 0x0200 /* Use TCP Fast Open to connect to server */
|
||||
|
@ -1527,7 +1527,6 @@ static int srv_parse_addr(char **args, int *cur_arg, struct proxy *curpx, struct
|
||||
}
|
||||
|
||||
srv->check.addr = srv->agent.addr = *sk;
|
||||
srv->flags |= SRV_F_CHECKADDR;
|
||||
srv->flags |= SRV_F_AGENTADDR;
|
||||
|
||||
out:
|
||||
@ -2050,7 +2049,6 @@ static int srv_parse_check_port(char **args, int *cur_arg, struct proxy *curpx,
|
||||
|
||||
global.maxsock++;
|
||||
srv->check.port = atol(args[*cur_arg+1]);
|
||||
srv->flags |= SRV_F_CHECKPORT;
|
||||
|
||||
out:
|
||||
return err_code;
|
||||
|
@ -1660,8 +1660,6 @@ static void srv_settings_cpy(struct server *srv, struct server *src, int srv_tmp
|
||||
srv->flags |= src->flags;
|
||||
srv->do_check = src->do_check;
|
||||
srv->do_agent = src->do_agent;
|
||||
if (srv->check.port)
|
||||
srv->flags |= SRV_F_CHECKPORT;
|
||||
srv->check.inter = src->check.inter;
|
||||
srv->check.fastinter = src->check.fastinter;
|
||||
srv->check.downinter = src->check.downinter;
|
||||
@ -3657,7 +3655,7 @@ const char *update_server_addr_port(struct server *s, const char *addr, const ch
|
||||
* we're switching from a fixed port to a SRV_F_MAPPORTS (mapped) port
|
||||
* prevent PORT change if check doesn't have it's dedicated port while switching
|
||||
* to port mapping */
|
||||
if ((s->check.state & CHK_ST_CONFIGURED) && !(s->flags & SRV_F_CHECKPORT)) {
|
||||
if (!s->check.port) {
|
||||
chunk_appendf(msg, "can't change <port> to port map because it is incompatible with current health check port configuration (use 'port' statement from the 'server' directive.");
|
||||
goto out;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user