tOnly check pieces that can be read - libeech - bittorrent library
(HTM) git clone git://z3bra.org/libeech.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 59aab58e207a45ed4a4f9a32999c4decb2bf821d
(DIR) parent 6d93917b1646e7777780e7891ab8dc41e36e076d
(HTM) Author: z3bra <contactatz3bradotorg>
Date: Fri, 29 Jun 2018 07:58:29 +0200
Only check pieces that can be read
Diffstat:
M libeech.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
---
(DIR) diff --git a/libeech.c b/libeech.c
t@@ -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;