]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: queue: Change pendconn_get_next_strm into private function
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 6 Jun 2017 08:34:51 +0000 (10:34 +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 934e29dc830e197626c290c321edb2876d990293..11e16008d1e3acf42eb3353c3a478c982e11e3c9 100644 (file)
@@ -37,7 +37,6 @@
 extern struct pool_head *pool2_pendconn;
 
 int init_pendconn();
-struct stream *pendconn_get_next_strm(struct server *srv, struct proxy *px);
 struct pendconn *pendconn_add(struct stream *strm);
 void pendconn_free(struct pendconn *p);
 void process_srv_queue(struct server *s);
index 08a6c3dd998e34ec4083828901d690f3d631e9a2..68ae68b1b9400ca0e4ea05ceca18bd3b87ee84a7 100644 (file)
@@ -61,29 +61,6 @@ unsigned int srv_dynamic_maxconn(const struct server *s)
 }
 
 
-/*
- * Manages a server's connection queue. This function will try to dequeue as
- * many pending streams as possible, and wake them up.
- */
-void process_srv_queue(struct server *s)
-{
-       struct proxy  *p = s->proxy;
-       int maxconn;
-
-       /* First, check if we can handle some connections queued at the proxy. We
-        * will take as many as we can handle.
-        */
-
-       maxconn = srv_dynamic_maxconn(s);
-       while (s->served < maxconn) {
-               struct stream *strm = pendconn_get_next_strm(s, p);
-
-               if (strm == NULL)
-                       break;
-               task_wakeup(strm->task, TASK_WOKEN_RES);
-       }
-}
-
 /* 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.
@@ -97,7 +74,7 @@ void process_srv_queue(struct server *s)
  * The stream is immediately marked as "assigned", and both its <srv> and
  * <srv_conn> are set to <srv>,
  */
-struct stream *pendconn_get_next_strm(struct server *srv, struct proxy *px)
+static struct stream *pendconn_get_next_strm(struct server *srv, struct proxy *px)
 {
        struct pendconn *ps, *pp;
        struct stream *strm;
@@ -133,6 +110,29 @@ struct stream *pendconn_get_next_strm(struct server *srv, struct proxy *px)
        return strm;
 }
 
+/*
+ * Manages a server's connection queue. This function will try to dequeue as
+ * many pending streams as possible, and wake them up.
+ */
+void process_srv_queue(struct server *s)
+{
+       struct proxy  *p = s->proxy;
+       int maxconn;
+
+       /* First, check if we can handle some connections queued at the proxy. We
+        * will take as many as we can handle.
+        */
+
+       maxconn = srv_dynamic_maxconn(s);
+       while (s->served < maxconn) {
+               struct stream *strm = pendconn_get_next_strm(s, p);
+
+               if (strm == NULL)
+                       break;
+               task_wakeup(strm->task, TASK_WOKEN_RES);
+       }
+}
+
 /* Adds the stream <strm> to the pending connection list of server <strm>->srv
  * or to the one of <strm>->proxy if srv is NULL. All counters and back pointers
  * are updated accordingly. Returns NULL if no memory is available, otherwise the