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 <goldsimon@gmx.de>
This commit is contained in:
goldsimon 2018-02-03 21:53:44 +01:00
parent 053a5e6e13
commit 1a75112b47

View File

@ -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) {