torrentd

simple torrent daemon
git clone git@git.2f30.org/torrentd.git
Log | Files | Refs | LICENSE

commit 077e37b986539dbc11bfb54e1839a137dc87b318
parent 471d82a235cae10cf01e93fe0e919b8a90945c90
Author: sin <sin@2f30.org>
Date:   Mon, 21 Dec 2015 16:57:05 +0000

Fix GET request

Diffstat:
Mtracker.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tracker.c b/tracker.c @@ -22,7 +22,7 @@ tracker_get_peers(struct torrent *t, struct ben **peers) id = urlencode(peerid(), 20); r = snprintf(buf, sizeof(buf), "GET /%s?info_hash=%s&peer_id=%s&port=6881&uploaded=0&" - "downloaded=0&left=%zu&event=started\r\n\r\n", + "downloaded=0&left=%zu&event=started HTTP/1.1\r\n\r\n", path, infohash, id, t->files[0].len); if (r < 0 || (size_t)r >= sizeof(buf)) goto err0; @@ -33,7 +33,7 @@ tracker_get_peers(struct torrent *t, struct ben **peers) writeall(s, buf, r); r = readall(s, buf, sizeof(buf) - 1); buf[r] = '\0'; - + puts(buf); return 0; err0: free(url);