}
-/*
- * 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.
* 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;
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