summaryrefslogtreecommitdiffstats
path: root/src/core.c
diff options
context:
space:
mode:
authortiptorrent development team <tiptorrent@soleta.eu>2021-09-09 12:41:27 +0200
committertiptorrent development team <tiptorrent@soleta.eu>2021-09-29 15:48:03 +0200
commitb07785d2d1b1ed42ea5f863c006f6ee60eceabc2 (patch)
tree19777c08b4ee4bf38b4db7aeb55540c7b575b1bb /src/core.c
parent1b890bd11b0a856bd2e4cd2377db8c6f3f656d3d (diff)
activate pending clients only for large files
small files should not activate pending clients, otherwise max_clients is not fulfilled.
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core.c b/src/core.c
index d086dfe..95bb614 100644
--- a/src/core.c
+++ b/src/core.c
@@ -47,10 +47,12 @@ static void tip_client_release(struct ev_loop *loop, struct tip_client *cli)
free((void *)cli->uri);
free((void *)cli->path);
- free(cli);
num_clients--;
- tip_client_activate_pending();
+ if (tip_client_large_file(cli))
+ tip_client_activate_pending();
+
+ free(cli);
}
static int tip_client_payload_too_large(struct tip_client *cli)