From 6010fe62fda49ffb6a3fa7038b0c2feb61767263 Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Mon, 27 Sep 2021 11:27:30 +0200 Subject: download checksum file directly from server Remove assumption on small file to shortcircuit the redirect logic. --- src/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index 113eb1e..45853d9 100644 --- a/src/core.c +++ b/src/core.c @@ -49,7 +49,7 @@ static void tip_client_release(struct ev_loop *loop, struct tip_client *cli) free((void *)cli->path); if (cli->method == TIP_METHOD_GET) { - if (tip_client_large_file(cli)) { + if (!tip_client_checksum_file(cli)) { num_clients--; if (!cli->redirect) tip_client_activate_pending(false); @@ -192,7 +192,7 @@ static void tip_client_read_cb(struct ev_loop *loop, struct ev_io *io, int event } return; shutdown: - if (cli->size > FILE_SIZE_THRESHOLD) + if (!tip_client_checksum_file(cli)) tip_client_redirect_create(cli); close: tip_client_release(loop, cli); -- cgit v1.2.3-18-g5258