From 26f55f1eb3cac7cdf59876c8c481309624a752bc Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 21 Nov 2017 12:22:19 +0100 Subject: [PATCH] makefsdata: add information about SSI and about the version of the included header to files Signed-off-by: goldsimon --- src/apps/httpd/makefsdata/makefsdata.c | 20 ++++++++++++++++++++ src/include/lwip/apps/fs.h | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/apps/httpd/makefsdata/makefsdata.c b/src/apps/httpd/makefsdata/makefsdata.c index f03c2238..1ee01ea7 100644 --- a/src/apps/httpd/makefsdata/makefsdata.c +++ b/src/apps/httpd/makefsdata/makefsdata.c @@ -768,6 +768,9 @@ int process_file(FILE *data_file, FILE *struct_file, const char *filename) fprintf(data_file, NEWLINE); is_ssi = is_ssi_file(filename); + if (is_ssi) { + flags |= FS_FILE_FLAGS_SSI; + } has_content_len = !is_ssi; can_be_compressed = includeHttpHeader && !is_ssi; file_data = get_file_data(filename, &file_size, can_be_compressed, &is_compressed); @@ -776,6 +779,9 @@ int process_file(FILE *data_file, FILE *struct_file, const char *filename) flags |= FS_FILE_FLAGS_HEADER_INCLUDED; if (has_content_len) { flags |= FS_FILE_FLAGS_HEADER_PERSISTENT; + if (useHttp11) { + flags |= FS_FILE_FLAGS_HEADER_HTTPVER_1_1; + } } } if (precalcChksum) { @@ -801,6 +807,20 @@ int process_file(FILE *data_file, FILE *struct_file, const char *filename) fputs("FS_FILE_FLAGS_HEADER_PERSISTENT", struct_file); flags_printed = 1; } + if (flags & FS_FILE_FLAGS_HEADER_HTTPVER_1_1) { + if (flags_printed) { + fputs(" | ", struct_file); + } + fputs("FS_FILE_FLAGS_HEADER_HTTPVER_1_1", struct_file); + flags_printed = 1; + } + if (flags & FS_FILE_FLAGS_SSI) { + if (flags_printed) { + fputs(" | ", struct_file); + } + fputs("FS_FILE_FLAGS_SSI", struct_file); + flags_printed = 1; + } if (!flags_printed) { fputs("0", struct_file); } diff --git a/src/include/lwip/apps/fs.h b/src/include/lwip/apps/fs.h index 1c119fe7..67b9a60a 100644 --- a/src/include/lwip/apps/fs.h +++ b/src/include/lwip/apps/fs.h @@ -52,7 +52,7 @@ struct fsdata_chksum { #define FS_FILE_FLAGS_HEADER_INCLUDED 0x01 #define FS_FILE_FLAGS_HEADER_PERSISTENT 0x02 -#define FS_FILE_FLAGS_HEADER_KEEPALIVE 0x04 +#define FS_FILE_FLAGS_HEADER_HTTPVER_1_1 0x04 #define FS_FILE_FLAGS_SSI 0x08 /** Define FS_FILE_EXTENSION_T_DEFINED if you have typedef'ed to your private