From 06782c699c218f80fa9dda351f10da0d6d0341bc Mon Sep 17 00:00:00 2001 From: goldsimon Date: Fri, 1 Jul 2016 12:43:03 +0200 Subject: [PATCH] httpd: fixed persistent connections for files not containing HTTP header --- src/apps/httpd/httpd.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/apps/httpd/httpd.c b/src/apps/httpd/httpd.c index 00bd21a6..18d4adbf 100644 --- a/src/apps/httpd/httpd.c +++ b/src/apps/httpd/httpd.c @@ -1002,7 +1002,8 @@ get_http_headers(struct http_state *hs, const char *uri) add_content_len = 0; /* @todo: get maximum file length from SSI */ } else #endif /* LWIP_HTTPD_SSI */ - if ((hs->handle == NULL) || ((hs->handle->flags & FS_FILE_FLAGS_HEADER_PERSISTENT) == 0)) { + if ((hs->handle == NULL) || + ((hs->handle->flags & (FS_FILE_FLAGS_HEADER_INCLUDED|FS_FILE_FLAGS_HEADER_PERSISTENT)) == FS_FILE_FLAGS_HEADER_INCLUDED)) { add_content_len = 0; } if (add_content_len) { @@ -2381,7 +2382,8 @@ http_init_file(struct http_state *hs, struct fs_file *file, int is_09, const cha } else #endif /* LWIP_HTTPD_SSI */ { - if ((hs->handle != NULL) && ((hs->handle->flags & FS_FILE_FLAGS_HEADER_PERSISTENT) == 0)) { + if ((hs->handle != NULL) && + ((hs->handle->flags & (FS_FILE_FLAGS_HEADER_INCLUDED|FS_FILE_FLAGS_HEADER_PERSISTENT)) == FS_FILE_FLAGS_HEADER_INCLUDED)) { hs->keepalive = 0; } }