From fcbec726e5e5fadaad46fa05fcc13f7c9f8810ea Mon Sep 17 00:00:00 2001 From: Richard Nyberg Date: Wed, 3 Aug 2005 21:08:04 +0000 Subject: [PATCH] Only allocate one have message for all peers, instead of one per peer. --- btpd/policy_if.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/btpd/policy_if.c b/btpd/policy_if.c index 88d49fe..f1b2e44 100644 --- a/btpd/policy_if.c +++ b/btpd/policy_if.c @@ -137,8 +137,9 @@ cm_on_ok_piece(struct piece *pc) tp->have_npieces++; msync(tp->imem, tp->isiz, MS_ASYNC); + struct net_buf *have = nb_create_have(pc->index); BTPDQ_FOREACH(p, &tp->peers, cm_entry) - peer_have(p, pc->index); + peer_send(p, have); if (tp->endgame) BTPDQ_FOREACH(p, &tp->peers, cm_entry)