From 17fba8701e3313e552be7a230b55c3c85622d915 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Mon, 26 Apr 2010 10:27:38 +0100 Subject: [PATCH] A comment to explain selection of conns --- backends/innduct.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backends/innduct.c b/backends/innduct.c index 428d021..c2ca557 100644 --- a/backends/innduct.c +++ b/backends/innduct.c @@ -837,6 +837,13 @@ static void check_master_queue(void) { Conn *walk, *use=0; int spare; + + /* Find a connection to offer this article. We prefer a busy + * connection to an idle one, provided it's not full. We take the + * first (oldest) and since that's stable, it will mean we fill up + * connections in order. That way if we have too many + * connections, the spare ones will go away eventually. + */ for (walk=LIST_HEAD(conns); walk; walk=LIST_NEXT(walk)) { int inqueue= walk->sent.count + walk->queue.count; spare= walk->max_queue - inqueue; -- 2.30.2