summaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index 298112d..a9fba30 100644
--- a/src/main.c
+++ b/src/main.c
@@ -552,6 +552,7 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}
addr = argv[1];
+ filename = argv[2];
openlog("tiptorrent-client", LOG_PID, LOG_DAEMON);
@@ -562,8 +563,7 @@ int main(int argc, char *argv[])
gettimeofday(&tv_start, NULL);
do {
- filename = argv[2];
- memset(&_cli, 0, sizeof(_cli));
+ tip_client_reset_state(&_cli, -1, 0);
_cli.state = TIP_CLIENT_HEAD_HEADER;
ret = tip_client_request_file(&_cli, addr, filename);
} while (ret > 0);