From 1a75112b473884e4b7b23304297920a12fe221ea Mon Sep 17 00:00:00 2001 From: goldsimon Date: Sat, 3 Feb 2018 21:53:44 +0100 Subject: [PATCH] httpd: ensure hs->keepalive is 0 if content length is not sent Connections for custom files without the persistent flag were not closed without this change. Signed-off-by: goldsimon --- src/apps/httpd/httpd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/apps/httpd/httpd.c b/src/apps/httpd/httpd.c index aca6d3b1..342750dd 100644 --- a/src/apps/httpd/httpd.c +++ b/src/apps/httpd/httpd.c @@ -957,6 +957,7 @@ get_http_headers(struct http_state *hs, const char *uri) hs->hdrs[HDR_STRINGS_IDX_CONTENT_LEN_KEEPALIVE] = g_psHTTPHeaderStrings[HTTP_HDR_KEEPALIVE_LEN]; } else { hs->hdrs[HDR_STRINGS_IDX_CONTENT_LEN_KEEPALIVE] = g_psHTTPHeaderStrings[HTTP_HDR_CONN_CLOSE]; + hs->keepalive = 0; } #else /* LWIP_HTTPD_SUPPORT_11_KEEPALIVE */ if (add_content_len) {