mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
CLEANUP: server: rename findserver() to server_find_by_name()
Now it's more logical and matches what is done in the rest of these functions. server_find() now relies on it.
This commit is contained in:
parent
6ad9285796
commit
61acd15ea8
@ -61,7 +61,7 @@ const char *srv_update_check_addr_port(struct server *s, const char *addr, const
|
|||||||
const char *srv_update_agent_addr_port(struct server *s, const char *addr, const char *port);
|
const char *srv_update_agent_addr_port(struct server *s, const char *addr, const char *port);
|
||||||
struct server *server_find_by_id(struct proxy *bk, int id);
|
struct server *server_find_by_id(struct proxy *bk, int id);
|
||||||
struct server *server_find_by_id_unique(struct proxy *bk, int id, uint32_t rid);
|
struct server *server_find_by_id_unique(struct proxy *bk, int id, uint32_t rid);
|
||||||
struct server *findserver(struct proxy *px, const char *name);
|
struct server *server_find_by_name(struct proxy *px, const char *name);
|
||||||
struct server *server_find(struct proxy *bk, const char *name);
|
struct server *server_find(struct proxy *bk, const char *name);
|
||||||
struct server *server_find_unique(struct proxy *bk, const char *name, uint32_t rid);
|
struct server *server_find_unique(struct proxy *bk, const char *name, uint32_t rid);
|
||||||
struct server *server_find_best_match(struct proxy *bk, char *name, int id, int *diff);
|
struct server *server_find_best_match(struct proxy *bk, char *name, int id, int *diff);
|
||||||
|
@ -3313,7 +3313,7 @@ int check_config_validity()
|
|||||||
|
|
||||||
srule->dynamic = 0;
|
srule->dynamic = 0;
|
||||||
srule->srv.name = server_name;
|
srule->srv.name = server_name;
|
||||||
target = findserver(curproxy, srule->srv.name);
|
target = server_find_by_name(curproxy, srule->srv.name);
|
||||||
err_code |= warnif_tcp_http_cond(curproxy, srule->cond);
|
err_code |= warnif_tcp_http_cond(curproxy, srule->cond);
|
||||||
|
|
||||||
if (!target) {
|
if (!target) {
|
||||||
|
@ -1440,7 +1440,7 @@ __LJMP int hlua_lua2arg_check(lua_State *L, int first, struct arg *argp,
|
|||||||
sname = argp[idx].data.str.area;
|
sname = argp[idx].data.str.area;
|
||||||
px = p;
|
px = p;
|
||||||
}
|
}
|
||||||
argp[idx].data.srv = findserver(px, sname);
|
argp[idx].data.srv = server_find_by_name(px, sname);
|
||||||
if (!argp[idx].data.srv) {
|
if (!argp[idx].data.srv) {
|
||||||
msg = "server doesn't exist";
|
msg = "server doesn't exist";
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -1498,7 +1498,7 @@ int smp_resolve_args(struct proxy *p, char **err)
|
|||||||
sname = arg->data.str.area;
|
sname = arg->data.str.area;
|
||||||
}
|
}
|
||||||
|
|
||||||
srv = findserver(px, sname);
|
srv = server_find_by_name(px, sname);
|
||||||
if (!srv) {
|
if (!srv) {
|
||||||
memprintf(err, "%sparsing [%s:%d]: unable to find server '%s' in proxy '%s', referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
|
memprintf(err, "%sparsing [%s:%d]: unable to find server '%s' in proxy '%s', referenced in arg %d of %s%s%s%s '%s' %s proxy '%s'.\n",
|
||||||
*err ? *err : "", cur->file, cur->line, sname, pname,
|
*err ? *err : "", cur->file, cur->line, sname, pname,
|
||||||
|
@ -4006,7 +4006,7 @@ struct server *server_find_by_id_unique(struct proxy *bk, int id, uint32_t rid)
|
|||||||
* This function returns the server with a matching name within selected proxy,
|
* This function returns the server with a matching name within selected proxy,
|
||||||
* or NULL if not found.
|
* or NULL if not found.
|
||||||
*/
|
*/
|
||||||
struct server *findserver(struct proxy *px, const char *name)
|
struct server *server_find_by_name(struct proxy *px, const char *name)
|
||||||
{
|
{
|
||||||
struct ebpt_node *node;
|
struct ebpt_node *node;
|
||||||
struct server *cursrv;
|
struct server *cursrv;
|
||||||
@ -6553,7 +6553,7 @@ int srv_apply_track(struct server *srv, struct proxy *curproxy)
|
|||||||
px = curproxy;
|
px = curproxy;
|
||||||
}
|
}
|
||||||
|
|
||||||
strack = findserver(px, sname);
|
strack = server_find_by_name(px, sname);
|
||||||
if (!strack) {
|
if (!strack) {
|
||||||
ha_alert("unable to find required server '%s' for tracking.\n",
|
ha_alert("unable to find required server '%s' for tracking.\n",
|
||||||
sname);
|
sname);
|
||||||
|
@ -1791,7 +1791,7 @@ static int stats_process_http_post(struct stconn *sc)
|
|||||||
}
|
}
|
||||||
reprocess = 1;
|
reprocess = 1;
|
||||||
}
|
}
|
||||||
else if ((sv = findserver(px, value)) != NULL) {
|
else if ((sv = server_find_by_name(px, value)) != NULL) {
|
||||||
HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
|
HA_SPIN_LOCK(SERVER_LOCK, &sv->lock);
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case ST_ADM_ACTION_DISABLE:
|
case ST_ADM_ACTION_DISABLE:
|
||||||
|
@ -1220,7 +1220,7 @@ static int process_server_rules(struct stream *s, struct channel *req, int an_bi
|
|||||||
if (!build_logline(s, tmp->area, tmp->size, &rule->expr))
|
if (!build_logline(s, tmp->area, tmp->size, &rule->expr))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
srv = findserver(s->be, tmp->area);
|
srv = server_find_by_name(s->be, tmp->area);
|
||||||
if (!srv)
|
if (!srv)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user