From d00d1fc36abad95f90bc7fb8d9ec80b0186485e1 Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Tue, 30 Jan 2007 17:13:24 +0000 Subject: [PATCH] Call peer_on_no_reqs at the appropriate time. --- btpd/peer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btpd/peer.c b/btpd/peer.c index 864acb0..f84d886 100644 --- a/btpd/peer.c +++ b/btpd/peer.c @@ -474,9 +474,9 @@ peer_on_piece(struct peer *p, uint32_t index, uint32_t begin, assert(p->nreqs_out > 0); p->nreqs_out--; BTPDQ_REMOVE(&p->my_reqs, req, p_entry); - dl_on_block(p, req, index, begin, length, data); if (p->nreqs_out == 0) peer_on_no_reqs(p); + dl_on_block(p, req, index, begin, length, data); } else btpd_log(BTPD_L_MSG, "discarded piece(%u,%u,%u) from %p\n", index, begin, length, p);