From f3a55dbd2235684f4e9711511e0c87353c0a3773 Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Fri, 9 Jun 2017 14:26:38 +0200 Subject: [PATCH] MINOR: queue: Change pendconn_from_srv/pendconn_from_px into private functions --- include/proto/queue.h | 21 --------------------- src/queue.c | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/include/proto/queue.h b/include/proto/queue.h index 11e16008d..81b1ddaf2 100644 --- a/include/proto/queue.h +++ b/include/proto/queue.h @@ -44,27 +44,6 @@ unsigned int srv_dynamic_maxconn(const struct server *s); int pendconn_redistribute(struct server *s); int pendconn_grab_from_px(struct server *s); - -/* Returns the first pending connection for server , which may be NULL if - * nothing is pending. - */ -static inline struct pendconn *pendconn_from_srv(const struct server *s) { - if (!s->nbpend) - return NULL; - - return LIST_ELEM(s->pendconns.n, struct pendconn *, list); -} - -/* Returns the first pending connection for proxy , which may be NULL if - * nothing is pending. - */ -static inline struct pendconn *pendconn_from_px(const struct proxy *px) { - if (!px->nbpend) - return NULL; - - return LIST_ELEM(px->pendconns.n, struct pendconn *, list); -} - /* Returns 0 if all slots are full on a server, or 1 if there are slots available. */ static inline int server_has_room(const struct server *s) { return !s->maxconn || s->cur_sess < srv_dynamic_maxconn(s); diff --git a/src/queue.c b/src/queue.c index 68ae68b1b..bd0a137ec 100644 --- a/src/queue.c +++ b/src/queue.c @@ -61,6 +61,26 @@ unsigned int srv_dynamic_maxconn(const struct server *s) } +/* Returns the first pending connection for server , which may be NULL if + * nothing is pending. + */ +static inline struct pendconn *pendconn_from_srv(const struct server *s) { + if (!s->nbpend) + return NULL; + return LIST_ELEM(s->pendconns.n, struct pendconn *, list); +} + +/* Returns the first pending connection for proxy , which may be NULL if + * nothing is pending. + */ +static inline struct pendconn *pendconn_from_px(const struct proxy *px) { + if (!px->nbpend) + return NULL; + + return LIST_ELEM(px->pendconns.n, struct pendconn *, list); +} + + /* Detaches the next pending connection from either a server or a proxy, and * returns its associated stream. If no pending connection is found, NULL is * returned. Note that neither nor may be NULL.