From 8cf20e663952b3a42568577d7f6e0066547422f7 Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Sat, 18 Sep 2021 23:41:14 +0200 Subject: incorrect mbytes/second stats accumulate data from all file --- src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 36cba55..041309b 100644 --- a/src/main.c +++ b/src/main.c @@ -401,6 +401,7 @@ int main(int argc, char *argv[]) { struct timeval tv_start, tv_stop, tv; bool file_chunk[MAX_CHUNKS] = {}; + uint64_t data_len = 0; int i, k; if (argc != 3) { @@ -433,6 +434,7 @@ int main(int argc, char *argv[]) ev_loop(tip_main_loop, 0); file_chunk[k] = true; + data_len += _cli.data_len; } if (_cli.state == TIP_CLIENT_DONE) { @@ -441,7 +443,7 @@ int main(int argc, char *argv[]) printf("Done in %lu.%06lu seconds (%lu Mbytes/second). " "Direct from server: %u Redirected: %u\n", tv.tv_sec, tv.tv_usec, - _cli.data_len / 1024000 / tv.tv_sec, + data_len / 1024000 / tv.tv_sec, tip_client_stats.direct_from_server, tip_client_stats.redirects); return EXIT_SUCCESS; -- cgit v1.2.3-18-g5258