diff options
author | tiptorrent development team <tiptorrent@soleta.eu> | 2021-09-18 23:41:14 +0200 |
---|---|---|
committer | tiptorrent development team <tiptorrent@soleta.eu> | 2021-09-18 23:41:14 +0200 |
commit | 8cf20e663952b3a42568577d7f6e0066547422f7 (patch) | |
tree | ec8662d3abd8db4d2e2c8b13059b4236b68074b5 | |
parent | 5ad75d7db0214cb68555d46d5f493fd50f317c9e (diff) |
incorrect mbytes/second stats
accumulate data from all file
-rw-r--r-- | src/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; |