libeech

BitTorrent library
git clone git://z3bra.org/libeech.git
Log | Files | Refs | README | LICENSE

commit 115117034d00618ff235ffc27b60277035a0e759
parent 774c0676d1298d2731342468f3f53c0f4e5a9630
Author: z3bra <contactatz3bradotorg>
Date:   Thu Jul  5 08:14:42 +0200

Group leeching-related actions together

Diffstat:
libeech.c | 14++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/libeech.c b/libeech.c @@ -664,13 +664,15 @@ pwptx(struct torrent *t, struct peer *p) p->state |= HANDSHAKESENT; } - if ((p->state & LEECHING) && !(p->state & AMINTERESTED)) { - pwptxst(p, INTERESTED); - p->state |= AMINTERESTED; - } + if (p->state & LEECHING) { + if (!(p->state & AMINTERESTED)) { + pwptxst(p, INTERESTED); + p->state |= AMINTERESTED; + } - if ((p->state & LEECHING) && !(p->state & AMCHOKING) && p->piece.n < 0) - pwptxrq(t, p); + if (!(p->state & AMCHOKING) && p->piece.n < 0) + pwptxrq(t, p); + } return 0; }