From: Christopher Faulet Date: Tue, 6 Jun 2017 08:34:51 +0000 (+0200) Subject: MINOR: queue: Change pendconn_get_next_strm into private function X-Git-Tag: v1.8-dev3~273 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=87566c923b07af3373be7526572e5a4473507617;p=thirdparty%2Fhaproxy.git MINOR: queue: Change pendconn_get_next_strm into private function --- diff --git a/include/proto/queue.h b/include/proto/queue.h index 934e29dc83..11e16008d1 100644 --- a/include/proto/queue.h +++ b/include/proto/queue.h @@ -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); diff --git a/src/queue.c b/src/queue.c index 08a6c3dd99..68ae68b1b9 100644 --- a/src/queue.c +++ b/src/queue.c @@ -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 nor may be NULL. @@ -97,7 +74,7 @@ void process_srv_queue(struct server *s) * The stream is immediately marked as "assigned", and both its and * are set to , */ -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 to the pending connection list of server ->srv * or to the one of ->proxy if srv is NULL. All counters and back pointers * are updated accordingly. Returns NULL if no memory is available, otherwise the