BUG/MINOR: server: parse_server() must take a const for the defproxy

The default proxy was passed as a variable, which in addition to being
a PITA to deal with in the config parser, doesn't feel safe to use when
it ought to be const.

This will only affect new code so no backport is needed.
This commit is contained in:
Willy Tarreau 2021-02-12 12:15:05 +01:00
parent 54fa7e332a
commit bb8669ae28
2 changed files with 2 additions and 2 deletions

View File

@ -44,7 +44,7 @@ extern struct dict server_key_dict;
int srv_downtime(const struct server *s);
int srv_lastsession(const struct server *s);
int srv_getinter(const struct check *check);
int parse_server(const char *file, int linenum, char **args, struct proxy *curproxy, struct proxy *defproxy, int parse_addr, int in_peers_section, int initial_resolve);
int parse_server(const char *file, int linenum, char **args, struct proxy *curproxy, const struct proxy *defproxy, int parse_addr, int in_peers_section, int initial_resolve);
int update_server_addr(struct server *s, void *ip, int ip_sin_family, const char *updater);
const char *update_server_addr_port(struct server *s, const char *addr, const char *port, char *updater);
struct server *server_find_by_id(struct proxy *bk, int id);

View File

@ -1940,7 +1940,7 @@ static int server_template_init(struct server *srv, struct proxy *px)
}
int parse_server(const char *file, int linenum, char **args, struct proxy *curproxy,
struct proxy *defproxy, int parse_addr, int in_peers_section, int initial_resolve)
const struct proxy *defproxy, int parse_addr, int in_peers_section, int initial_resolve)
{
struct server *newsrv = NULL;
const char *err = NULL;