BUILD: checks: fix inlining issue on set_srv_agent_[addr,port}

These functions are declared as external functions in check.h and
as inline functions in check.c. Let's move them as static inline in
check.h. This appeared in 2.4 with the following commits:

  4858fb2e1 ("MEDIUM: check: align agentaddr and agentport behaviour")
  1c921cd74 ("BUG/MINOR: check: consitent way to set agentaddr")

While harmless (it only triggers build warnings with some gcc 4.x),
it should probably be backported where the paches above are present
to keep the code consistent.
This commit is contained in:
Willy Tarreau 2022-01-28 09:16:47 +01:00
parent a65b4933ba
commit 95d3eaff36
2 changed files with 14 additions and 16 deletions

View File

@ -90,8 +90,20 @@ int spoe_prepare_healthcheck_request(char **req, int *len);
int spoe_handle_healthcheck_response(char *frame, size_t size, char *err, int errlen);
int set_srv_agent_send(struct server *srv, const char *send);
void set_srv_agent_addr(struct server *srv, struct sockaddr_storage *sk);
void set_srv_agent_port(struct server *srv, int port);
/* set agent addr and appropriate flag */
static inline void set_srv_agent_addr(struct server *srv, struct sockaddr_storage *sk)
{
srv->agent.addr = *sk;
srv->flags |= SRV_F_AGENTADDR;
}
/* set agent port and appropriate flag */
static inline void set_srv_agent_port(struct server *srv, int port)
{
srv->agent.port = port;
srv->flags |= SRV_F_AGENTPORT;
}
/* Use this one only. This inline version only ensures that we don't
* call the function when the observe mode is disabled.

View File

@ -1983,20 +1983,6 @@ int set_srv_agent_send(struct server *srv, const char *send)
return 0;
}
/* set agent addr and appropriate flag */
inline void set_srv_agent_addr(struct server *srv, struct sockaddr_storage *sk)
{
srv->agent.addr = *sk;
srv->flags |= SRV_F_AGENTADDR;
}
/* set agent port and appropriate flag */
inline void set_srv_agent_port(struct server *srv, int port)
{
srv->agent.port = port;
srv->flags |= SRV_F_AGENTPORT;
}
/* Parse the "agent-send" server keyword */
static int srv_parse_agent_send(char **args, int *cur_arg, struct proxy *curpx, struct server *srv,
char **errmsg)