From d6dbb6c979bc785e501cf109a7d155635b1647ea Mon Sep 17 00:00:00 2001 From: tiptorrent development team Date: Fri, 10 Sep 2021 17:06:35 +0200 Subject: add a close wait state Wait for clients to close the connection, then: - create redirection. - activate pending clients. Do no refresh timeout while in close wait state. --- src/handler.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/handler.c') diff --git a/src/handler.c b/src/handler.c index ab9fdc4..164a484 100644 --- a/src/handler.c +++ b/src/handler.c @@ -148,8 +148,10 @@ int tip_client_state_process_payload_bulk(struct tip_client *cli) { sendfile(tip_client_socket(cli), cli->fd, &cli->offset, BLOCK); - if (cli->offset >= cli->size) + if (cli->offset >= cli->size) { + cli->state = TIP_CLIENT_CLOSE_WAIT; return 1; + } return 0; } -- cgit v1.2.3-18-g5258