const char *server_inetaddr_updater_by_to_str(enum server_inetaddr_updater_by by);
const char *srv_update_check_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_unique(struct proxy *bk, int id, uint32_t rid);
struct server *server_find_by_name(struct proxy *px, const char *name);
struct server *server_find(struct proxy *bk, const char *name);
}
}
+/* Returns a pointer to the first server matching id <id> in backend <bk>.
+ * NULL is returned if no match is found.
+ */
+static inline struct server *server_find_by_id(struct proxy *bk, int id)
+{
+ struct eb32_node *eb32;
+
+ eb32 = eb32_lookup(&bk->conf.used_server_id, id);
+ return eb32 ? container_of(eb32, struct server, conf.id) : NULL;
+}
+
+
static inline int srv_is_quic(const struct server *srv)
{
#ifdef USE_QUIC
return err_code;
}
-/* Returns a pointer to the first server matching either id <id>.
- * NULL is returned if no match is found.
- * the lookup is performed in the backend <bk>
- */
-struct server *server_find_by_id(struct proxy *bk, int id)
-{
- struct eb32_node *eb32;
- struct server *curserver;
-
- if (!bk || (id ==0))
- return NULL;
-
- /* <bk> has no backend capabilities, so it can't have a server */
- if (!(bk->cap & PR_CAP_BE))
- return NULL;
-
- curserver = NULL;
-
- eb32 = eb32_lookup(&bk->conf.used_server_id, id);
- if (eb32)
- curserver = container_of(eb32, struct server, conf.id);
-
- return curserver;
-}
-
/*
* This function finds a server with matching "<puid> x <rid>" within
* selected backend <bk>.