tAdd comments - libeech - bittorrent library
(HTM) git clone git://z3bra.org/libeech.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 073f62ba589de7076916bc88119e6bc64ff0990b
(DIR) parent 1dbca24f67c51c35b0ea0c3b7e2d98b85eec5005
(HTM) Author: z3bra <contactatz3bradotorg>
Date: Sun, 22 Oct 2017 10:40:29 +0200
Add comments
Diffstat:
M libeech.c | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/libeech.c b/libeech.c
t@@ -116,12 +116,15 @@ glch_loadtorrent(struct torrent *t, char *b, size_t s)
if (chktorrent(&t->be) < 0)
return -1;
+ /* Calculate 'info' key checksum */
bekv(&t->be, "info", 4, &t->info);
sha1(t->info.start, t->info.end - t->info.start, t->ih);
+ /* save tracker URL */
bekstr(&t->be, "announce", 8, &v);
memcpy(t->tr, v.off, v.end - v.off);
+ /* Generate randomized peer ID */
memcpy(t->id, peerid(), 20);
t->id[20] = 0;