From 95a06d711178f20d0fe074a0b5db97727c06b1a4 Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Fri, 11 Feb 2022 10:43:09 +0100 Subject: no need to calculate chunk size in every iteration --- src/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index be30150..c387bd4 100644 --- a/src/main.c +++ b/src/main.c @@ -626,12 +626,12 @@ int main(int argc, char *argv[]) fd = _cli.fd; file_size = _cli.content_len; + chunk_size = file_size / MAX_CHUNKS; for (i = 0; i < MAX_CHUNKS; i++) { k = select_file_chunk(file_chunk); snprintf(_filename, sizeof(_filename), "%s.%u", argv[2], k); filename = _filename; - chunk_size = file_size / MAX_CHUNKS; if (tip_client_run(&_cli, fd, addr, filename, k, chunk_size) < 0) goto err_bailout; -- cgit v1.2.3-18-g5258