ttorrent: Print number of pieces acquired interactively - libeech - bittorrent library
(HTM) git clone git://z3bra.org/libeech.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 3698a0b5554fca72a59bbad6d7942387a168071b
(DIR) parent c849aac19002f74d44d63ad8350f00601325afd3
(HTM) Author: Willy Goiffon <dev@z3bra.org>
Date: Mon, 23 Mar 2020 20:14:23 +0100
ttorrent: Print number of pieces acquired interactively
Diffstat:
M torrent.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/torrent.c b/torrent.c
t@@ -83,8 +83,11 @@ main(int argc, char *argv[])
printf("\t%s\n", t.files[i].path);
glch_addpeer(&t, &peer, h, p);
- while (glch_piececount(&t) < t.npiece)
+ while (glch_piececount(&t) < t.npiece) {
glch_leech(&t, 5000);
+ printf("\rPieces: %d/%d", glch_piececount(&t), t.npiece);
+ fflush(stdout);
+ }
puts("\rDownload finished!");