]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: proxy: remove now unused function findproxy_mode()
authorWilly Tarreau <w@1wt.eu>
Tue, 26 May 2015 10:05:53 +0000 (12:05 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 26 May 2015 10:05:53 +0000 (12:05 +0200)
It's not used anymore.

include/proto/proxy.h
src/proxy.c

index 07ccc9650c71f5ea1d3f564c83a8028345b089fe..60d2af038fc575cf1fdc3f275d4c85e97874156f 100644 (file)
@@ -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);
index 5c8e26d96800538f3d229e4c56382d49ce57e18e..175e3bb51782fc169a589e02c699368759d55948 100644 (file)
@@ -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.