mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
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:
parent
a65b4933ba
commit
95d3eaff36
@ -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.
|
||||
|
14
src/check.c
14
src/check.c
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user