From 5d6ad9d7bb88dc2f7f22f3db0e568662d9e6cf20 Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Wed, 20 Jul 2005 20:57:06 +0000 Subject: [PATCH] Don't try to assign requests if the peer already has enough requests. --- btpd/policy_if.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/btpd/policy_if.c b/btpd/policy_if.c index b524eca..dbd17e9 100644 --- a/btpd/policy_if.c +++ b/btpd/policy_if.c @@ -39,14 +39,14 @@ cm_on_piece_ann(struct peer *p, uint32_t index) } } else if (pc == NULL) { peer_want(p, index); - if (!peer_chokes(p)) { + if (!peer_chokes(p) && !peer_laden(p)) { pc = cm_new_piece(tp, index); if (pc != NULL) cm_piece_assign_requests(pc, p); } } else if (!piece_full(pc)) { peer_want(p, index); - if (!peer_chokes(p)) + if (!peer_chokes(p) && !peer_laden(p)) cm_piece_assign_requests(pc, p); } }