mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-03-01 17:10:42 +00:00
CLEANUP: proxy: remove now unused function findproxy_mode()
It's not used anymore.
This commit is contained in:
parent
afb3992d35
commit
63d38fda4a
@ -48,7 +48,6 @@ int stream_set_backend(struct stream *s, struct proxy *be);
|
||||
const char *proxy_cap_str(int cap);
|
||||
const char *proxy_mode_str(int mode);
|
||||
void proxy_store_name(struct proxy *px);
|
||||
struct proxy *findproxy_mode(const char *name, int mode, int cap);
|
||||
struct proxy *proxy_find_by_name(const char *name, int cap, int table);
|
||||
struct server *findserver(const struct proxy *px, const char *name);
|
||||
int proxy_cfg_ensure_no_http(struct proxy *curproxy);
|
||||
|
42
src/proxy.c
42
src/proxy.c
@ -346,48 +346,6 @@ void proxy_store_name(struct proxy *px)
|
||||
ebis_insert(&proxy_by_name, &px->conf.by_name);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function finds a proxy with matching name, mode and with satisfying
|
||||
* capabilities. It also checks if there are more matching proxies with
|
||||
* requested name as this often leads into unexpected situations.
|
||||
*/
|
||||
|
||||
struct proxy *findproxy_mode(const char *name, int mode, int cap) {
|
||||
|
||||
struct proxy *curproxy, *target = NULL;
|
||||
struct ebpt_node *node;
|
||||
|
||||
for (node = ebis_lookup(&proxy_by_name, name); node; node = ebpt_next(node)) {
|
||||
curproxy = container_of(node, struct proxy, conf.by_name);
|
||||
|
||||
if (strcmp(curproxy->id, name) != 0)
|
||||
break;
|
||||
|
||||
if ((curproxy->cap & cap) != cap)
|
||||
continue;
|
||||
|
||||
if (curproxy->mode != mode &&
|
||||
!(curproxy->mode == PR_MODE_HTTP && mode == PR_MODE_TCP)) {
|
||||
Alert("Unable to use proxy '%s' with wrong mode, required: %s, has: %s.\n",
|
||||
name, proxy_mode_str(mode), proxy_mode_str(curproxy->mode));
|
||||
Alert("You may want to use 'mode %s'.\n", proxy_mode_str(mode));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!target) {
|
||||
target = curproxy;
|
||||
continue;
|
||||
}
|
||||
|
||||
Alert("Refusing to use duplicated proxy '%s' with overlapping capabilities: %s/%s!\n",
|
||||
name, proxy_type_str(curproxy), proxy_type_str(target));
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return target;
|
||||
}
|
||||
|
||||
/* Returns a pointer to the first proxy matching either name <name>, or id
|
||||
* <name> if <name> begins with a '#'. NULL is returned if no match is found.
|
||||
* If <table> is non-zero, it only considers proxies having a table.
|
||||
|
Loading…
Reference in New Issue
Block a user