From 88ba2fa7b414f3f63e66d1708f5bda9465e0ee89 Mon Sep 17 00:00:00 2001 From: Rafał Miłecki Date: Wed, 23 Sep 2020 12:43:27 +0200 Subject: client: really close connection on timeout MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After specified time of network inactivity uhttpd is meant to close connection. It doesn't seem to work thought. After timeout client doesn't receive any more data but connection it still opened. This change fixes that. Signed-off-by: Rafał Miłecki --- client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 2a2393f..b5736e4 100644 --- a/client.c +++ b/client.c @@ -95,7 +95,8 @@ static void client_timeout(struct uloop_timeout *timeout) struct client *cl = container_of(timeout, struct client, timeout); cl->state = CLIENT_STATE_CLOSE; - uh_connection_close(cl); + cl->request.connection_close = true; + uh_request_done(cl); } static void uh_set_client_timeout(struct client *cl, int timeout) -- cgit v1.2.3