summaryrefslogtreecommitdiffstats
path: root/src/core.c
diff options
context:
space:
mode:
authortiptorrent development team <tiptorrent@soleta.eu>2021-09-13 11:54:19 +0200
committertiptorrent development team <tiptorrent@soleta.eu>2021-09-29 15:48:16 +0200
commit7a04638c320c61eb52c0a849fc8cf5ddd6e1ad8c (patch)
tree5d37d25a266a90e4abbc58f3c134a0e054cb3c05 /src/core.c
parentcbcc71db72efb91adf7d7dac275de8ba4e12af0c (diff)
update num_clients and redirection only for large files
Skip num_clients and redirection update for small files.
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c5
1 files changed, 3 insertions, 2 deletions
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);