diff mbox series

[uhttpd,rfc] client: really close connection on timeout

Message ID 20200727181444.28780-1-zajec5@gmail.com
State Changes Requested
Delegated to: Rafał Miłecki
Headers show
Series [uhttpd,rfc] client: really close connection on timeout | expand

Commit Message

Rafał Miłecki July 27, 2020, 6:14 p.m. UTC
From: Rafał Miłecki <rafal@milecki.pl>

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>
---
While this fixes described problem I'm not sure if calling
uh_request_done() is the right thing to do. I need someone with better
uhttpd knowledge to review this.
---
 client.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/client.c b/client.c
index 2a2393f..e933e63 100644
--- a/client.c
+++ b/client.c
@@ -96,6 +96,7 @@  static void client_timeout(struct uloop_timeout *timeout)
 
 	cl->state = CLIENT_STATE_CLOSE;
 	uh_connection_close(cl);
+	uh_request_done(cl);
 }
 
 static void uh_set_client_timeout(struct client *cl, int timeout)