diff options
| author | Richard Nyberg <rnyberg@murmeldjur.se> | 2005-07-20 20:57:06 +0000 |
|---|---|---|
| committer | Richard Nyberg <rnyberg@murmeldjur.se> | 2005-07-20 20:57:06 +0000 |
| commit | 5d6ad9d7bb88dc2f7f22f3db0e568662d9e6cf20 (patch) | |
| tree | f588938fe6fb6a0c768f7daaf3ca944531c27034 | |
| parent | 0502d4bf9219527eb4af327db24d94763e1e49c9 (diff) | |
| download | btpd-5d6ad9d7bb88dc2f7f22f3db0e568662d9e6cf20.tar.gz btpd-5d6ad9d7bb88dc2f7f22f3db0e568662d9e6cf20.zip | |
Don't try to assign requests if the peer already has enough requests.
| -rw-r--r-- | btpd/policy_if.c | 4 |
1 files 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); } } |