chiark
/
gitweb
/
~ian
/
innduct.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7f3bda1
)
A comment to explain selection of conns
author
Ian Jackson
<ian@liberator.(none)>
Mon, 26 Apr 2010 09:27:38 +0000
(10:27 +0100)
committer
Ian Jackson
<ian@liberator.(none)>
Mon, 26 Apr 2010 09:27:38 +0000
(10:27 +0100)
backends/innduct.c
patch
|
blob
|
history
diff --git
a/backends/innduct.c
b/backends/innduct.c
index 428d021d76b00aa870765bf0ff2b7ea31f62f87b..c2ca557455c4f5927f54f027a98b6b7155f2b5a1 100644
(file)
--- a/
backends/innduct.c
+++ b/
backends/innduct.c
@@
-837,6
+837,13
@@
static void check_master_queue(void) {
Conn *walk, *use=0;
int spare;
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;
for (walk=LIST_HEAD(conns); walk; walk=LIST_NEXT(walk)) {
int inqueue= walk->sent.count + walk->queue.count;
spare= walk->max_queue - inqueue;