libeech

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

commit 59aab58e207a45ed4a4f9a32999c4decb2bf821d
parent 6d93917b1646e7777780e7891ab8dc41e36e076d
Author: z3bra <contactatz3bradotorg>
Date:   Fri Jun 29 07:58:29 +0200

Only check pieces that can be read

Diffstat:
libeech.c | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/libeech.c b/libeech.c @@ -570,10 +570,8 @@ glch_loadtorrent(struct torrent *t, char *b, size_t s) memset(t->bf, 0, t->npiece / 8 + 1); for (i = 0; i < t->npiece; i++) { - readpiece(t, &t->pieces[i], i); - if (!chkpiece(t, &t->pieces[i], i)) { + if (readpiece(t, &t->pieces[i], i) > 0 && !chkpiece(t, &t->pieces[i], i)) setbit(t->bf, i); - } } return 1;