Browse Source

Don't try to assign requests if the peer already has enough requests.

master
Richard Nyberg 19 years ago
parent
commit
5d6ad9d7bb
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      btpd/policy_if.c

+ 2
- 2
btpd/policy_if.c View File

@@ -39,14 +39,14 @@ cm_on_piece_ann(struct peer *p, uint32_t index)
} }
} else if (pc == NULL) { } else if (pc == NULL) {
peer_want(p, index); peer_want(p, index);
if (!peer_chokes(p)) {
if (!peer_chokes(p) && !peer_laden(p)) {
pc = cm_new_piece(tp, index); pc = cm_new_piece(tp, index);
if (pc != NULL) if (pc != NULL)
cm_piece_assign_requests(pc, p); cm_piece_assign_requests(pc, p);
} }
} else if (!piece_full(pc)) { } else if (!piece_full(pc)) {
peer_want(p, index); peer_want(p, index);
if (!peer_chokes(p))
if (!peer_chokes(p) && !peer_laden(p))
cm_piece_assign_requests(pc, p); cm_piece_assign_requests(pc, p);
} }
} }


Loading…
Cancel
Save