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.master
parent
67d9fde94c
commit
db4f4980c5
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue