From 900ae1d783dc34c8215480839b932c2438533f4a Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Tue, 8 Feb 2022 17:19:23 +0100 Subject: do not reset number of retries counter --- src/main.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/main.c b/src/main.c index 6b2b8c0..9771370 100644 --- a/src/main.c +++ b/src/main.c @@ -528,9 +528,12 @@ static uint32_t select_file_chunk(bool *file_chunk) static void tip_client_reset_state(struct tip_client *cli, int fd, uint64_t chunk_offset) { + int num_retries = cli->num_retries; + memset(cli, 0, sizeof(*cli)); cli->chunk_offset = chunk_offset; cli->fd = fd; + cli->num_retries = num_retries; } static char _filename[PATH_MAX + 1]; -- cgit v1.2.3-18-g5258