no need to calculate chunk size in every iteration

multiprocess
tiptorrent development team 2022-02-11 10:43:09 +01:00 committed by Pablo Neira Ayuso
parent d4753d6c3e
commit 95a06d7111
1 changed files with 1 additions and 1 deletions

View File

@ -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;