client: really close connection on timeout
authorRafał Miłecki <rafal@milecki.pl>
Wed, 23 Sep 2020 10:43:27 +0000 (12:43 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Thu, 1 Oct 2020 04:36:52 +0000 (06:36 +0200)
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 <rafal@milecki.pl>
client.c

index 2a2393f66a2750335148849b97435410eaf40de9..b5736e4b00fbd2bd66784b5b551ff2051ccb36f6 100644 (file)
--- 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)