From 7a04638c320c61eb52c0a849fc8cf5ddd6e1ad8c Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Mon, 13 Sep 2021 11:54:19 +0200 Subject: update num_clients and redirection only for large files Skip num_clients and redirection update for small files. --- src/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index c3d4c03..530c86a 100644 --- a/src/core.c +++ b/src/core.c @@ -50,9 +50,10 @@ static void tip_client_release(struct ev_loop *loop, struct tip_client *cli) free((void *)cli->path); if (cli->method == TIP_METHOD_GET) { - num_clients--; - if (tip_client_large_file(cli)) + if (tip_client_large_file(cli)) { + num_clients--; tip_client_activate_pending(); + } } free(cli); -- cgit v1.2.3-18-g5258