struct proxy *proxy_find_by_id(int id, int cap, int table);
struct proxy *proxy_find_by_name(const char *name, int cap, int table);
struct proxy *proxy_find_best_match(int cap, const char *name, int id, int *diff);
-struct server *findserver(const struct proxy *px, const char *name);
int proxy_cfg_ensure_no_http(struct proxy *curproxy);
int proxy_cfg_ensure_no_log(struct proxy *curproxy);
void init_new_proxy(struct proxy *p);
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_unique(struct proxy *bk, int id, uint32_t rid);
+struct server *findserver(const struct proxy *px, const char *name);
struct server *server_find_by_name(struct proxy *bk, const char *name);
struct server *server_find_by_name_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);
return NULL;
}
-/*
- * This function returns the server with a matching name within selected proxy,
- * or NULL if not found.
- */
-
-struct server *findserver(const struct proxy *px, const char *name)
-{
- struct server *cursrv;
-
- if (!px)
- return NULL;
-
- for (cursrv = px->srv; cursrv; cursrv = cursrv->next) {
- if (strcmp(cursrv->id, name) == 0)
- return cursrv;
- }
-
- return NULL;
-}
-
/* This function checks that the designated proxy has no http directives
* enabled. It will output a warning if there are, and will fix some of them.
* It returns the number of fatal errors encountered. This should be called
return curserver;
}
+/*
+ * This function returns the server with a matching name within selected proxy,
+ * or NULL if not found.
+ */
+
+struct server *findserver(const struct proxy *px, const char *name)
+{
+ struct server *cursrv;
+
+ if (!px)
+ return NULL;
+
+ for (cursrv = px->srv; cursrv; cursrv = cursrv->next) {
+ if (strcmp(cursrv->id, name) == 0)
+ return cursrv;
+ }
+
+ return NULL;
+}
+
/* Returns a pointer to the first server matching either name <name>, or id
* if <name> starts with a '#'. NULL is returned if no match is found.
* the lookup is performed in the backend <bk>