libeech

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

commit c9bfa5e7c88fa7ab0ed18797fa432164bc89e67f
parent a4a521c672ec7664c591e2fc30fde889300e9496
Author: z3bra <contactatz3bradotorg>
Date:   Fri Jun 29 21:24:59 +0200

Add bitfield for peers

Diffstat:
libeech.c | 1+
libeech.h | 2++
2 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/libeech.c b/libeech.c @@ -282,6 +282,7 @@ addpeer(struct peer *pl, char *host, int port) p->port = port; p->rxbufsz = 0; memcpy(p->host, host, HOST_NAME_MAX); + memset(p->bf, 0, PCENUM / 8); memset(p->rxbuf, 0, MSGSIZ); return p; diff --git a/libeech.h b/libeech.h @@ -3,6 +3,7 @@ #include "be.h" +#define PCENUM 65535 #define PCESIZ 1048576 #define BLKSIZ 16384 #define MSGSIZ ((BLKSIZ) + 13) @@ -32,6 +33,7 @@ struct peer { char host[HOST_NAME_MAX]; char rxbuf[MSGSIZ]; long rxbufsz; + char bf[PCENUM / 8]; struct peer *next; };