summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c3
1 files changed, 3 insertions, 0 deletions
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];