summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJose M. Guisado <jguisado@soleta.eu>2022-09-28 16:09:32 +0200
committerJose M. Guisado <jguisado@soleta.eu>2022-09-28 16:09:32 +0200
commitdb4f4980c5ee29a9fc74b3fe745ed74f58173a6f (patch)
treeb40dfdc8db674960ad4888e80410d434832c996d /src
parent67d9fde94c88d188b5873d9eab0cadcb2cc2e35c (diff)
keep client retries when tip_client_request_file fails
Keep client retry count when something goes wrong requesting file size (HEAD request). Fixes a bug where tiptorrent-client keeps sending HEAD requests indifinitely when something goes wrong at this stage.
Diffstat (limited to 'src')
-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);