From ee7abdea2a4e5cdcef3e02050d07a9f30e3eb57c Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Fri, 22 Jul 2005 10:27:17 +0000 Subject: [PATCH] The assert is only valid if we haven't transitioned to end game. --- btpd/policy_if.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/btpd/policy_if.c b/btpd/policy_if.c index 18b9e73..f31bb1d 100644 --- a/btpd/policy_if.c +++ b/btpd/policy_if.c @@ -58,8 +58,11 @@ cm_on_download(struct peer *p) struct torrent *tp = p->tp; if (tp->endgame) { cm_assign_requests_eg(p); - } else if (cm_assign_requests(p) == 0) - assert(!peer_wanted(p) || peer_laden(p)); + } else { + unsigned count = cm_assign_requests(p); + if (count == 0 && !p->tp->endgame) // We may have entered end game. + assert(!peer_wanted(p) || peer_laden(p)); + } } void