tAdd bitfield for peers - libeech - bittorrent library
 (HTM) git clone git://z3bra.org/libeech.git
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit c9bfa5e7c88fa7ab0ed18797fa432164bc89e67f
 (DIR) parent a4a521c672ec7664c591e2fc30fde889300e9496
 (HTM) Author: z3bra <contactatz3bradotorg>
       Date:   Fri, 29 Jun 2018 21:24:59 +0200
       
       Add bitfield for peers
       
       Diffstat:
         M libeech.c                           |       1 +
         M libeech.h                           |       2 ++
       
       2 files changed, 3 insertions(+), 0 deletions(-)
       ---
 (DIR) diff --git a/libeech.c b/libeech.c
       t@@ -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;
 (DIR) diff --git a/libeech.h b/libeech.h
       t@@ -3,6 +3,7 @@
        
        #include "be.h"
        
       +#define PCENUM 65535
        #define PCESIZ 1048576
        #define BLKSIZ 16384
        #define MSGSIZ ((BLKSIZ) + 13)
       t@@ -32,6 +33,7 @@ struct peer {
                char host[HOST_NAME_MAX];
                char rxbuf[MSGSIZ];
                long rxbufsz;
       +        char bf[PCENUM / 8];
                struct peer *next;
        };