libeech

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

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

Print message ID only when we receive a message

Diffstat:
libeech.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libeech.c b/libeech.c @@ -448,8 +448,8 @@ pwprx(struct torrent *t, struct peer *p) p->buflen = 0; p->state |= HANDSHAKERCVD; } else { - p->buflen = pwprecv(p); - printf("Message ID: %d (%d bytes)\n", p->buf[4], U32(p->buf)); + if (!(p->buflen = pwprecv(p))) + printf("Message ID: %d (%d bytes)\n", p->buf[4], U32(p->buf)); } return 0; }