]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: queue: Change pendconn_from_srv/pendconn_from_px into private functions
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 9 Jun 2017 12:26:38 +0000 (14:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 27 Jun 2017 12:38:02 +0000 (14:38 +0200)
include/proto/queue.h
src/queue.c

index 11e16008d1e3acf42eb3353c3a478c982e11e3c9..81b1ddaf2ef50ccb7b271eec4bfa4ce9f144654e 100644 (file)
@@ -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 <s>, 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 <px>, 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);
index 68ae68b1b9400ca0e4ea05ceca18bd3b87ee84a7..bd0a137ec8a3f3491db237ef35dc046dc6524dbb 100644 (file)
@@ -61,6 +61,26 @@ unsigned int srv_dynamic_maxconn(const struct server *s)
 }
 
 
+/* Returns the first pending connection for server <s>, 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 <px>, 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 <srv> nor <px> may be NULL.