libeech

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

commit 01ff08c8da3239cd769ae07f45977aa828f5cc31
parent 49ad884d0032f329b4d6006b1541dc3ff737148f
Author: z3bra <contactatz3bradotorg>
Date:   Mon,  9 Jul 2018 08:30:42 +0200

Make default bitfield size more accurate

Diffstat:
libeech.h | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/libeech.h b/libeech.h @@ -24,8 +24,8 @@ struct piece { int n; ssize_t sz; char blks[PCESIZ]; - char bf[PCENUM / 8]; - char rq[PCENUM / 8]; + char bf[PCENUM / 8 + !!(PCENUM % 8)]; + char rq[PCENUM / 8 + !!(PCENUM % 8)]; }; struct peer { @@ -35,7 +35,8 @@ struct peer { char host[HOST_NAME_MAX]; char rxbuf[MSGSIZ]; long rxbufsz; - char bf[PCENUM / 8]; + char bf[PCENUM / 8 + !!(PCENUM % 8)]; + char view[PCENUM / 8 + !!(PCENUM % 8)]; struct piece piece; struct peer *next; };